MulAdd implemented
This commit is contained in:
@@ -191,5 +191,23 @@ protected:
|
||||
value_type *dstData; //where results will be putted
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
MulAdd layer
|
||||
apply a multiplication and then an addition for each data
|
||||
*/
|
||||
class MulAdd : public Layer {
|
||||
|
||||
public:
|
||||
MulAdd(Network *net, dataDim_t input_dim, value_type mul, value_type add);
|
||||
virtual ~MulAdd();
|
||||
|
||||
value_type* infer(dataDim_t &dim, value_type* srcData);
|
||||
|
||||
protected:
|
||||
value_type mul, add;
|
||||
value_type *dstData, *add_vector; //where results will be putted
|
||||
};
|
||||
|
||||
}
|
||||
#endif //LAYER_H
|
||||
@@ -65,6 +65,9 @@
|
||||
void readBinaryFile(const char* fname, int size, value_type** data_h, value_type** data_d);
|
||||
void printDeviceVector(int size, value_type* vec_d);
|
||||
void resize(int size, value_type **data);
|
||||
|
||||
void matrixTranspose(cublasHandle_t handle, value_type* srcData, value_type* dstData, int rows, int cols);
|
||||
|
||||
void matrixMulAdd( cublasHandle_t handle, value_type* srcData, value_type* dstData,
|
||||
value_type* add_vector, int dim, value_type mul);
|
||||
#endif //UTILS_H
|
||||
Reference in New Issue
Block a user