Added bugfix to object initialization
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
*/
class Layer {
public:
- Layer();
+ Layer() :
+ last_layer(false),
+ init_zero(false),
+ type(LAYER_UNKNOWN),
+ activation(NULL),
+ activation_prime(NULL),
+ activation_type(ACT_UNKNOWN),
+ bn_follow(false),
+ weight_decay(),
+ weight_ini_type(WEIGHT_UNKNOWN) {}
+
/**
* @brief Destructor of Layer Class
*/
/**
* @brief type for the Weight Decay hyper-parameter
*/
-typedef struct {
+typedef struct WeightDecayParam_ {
WeightDecayType type;
float lambda;
+
+ WeightDecayParam_() : type(WeightDecayType::unknown), lambda(0.0) {}
} WeightDecayParam;
/**
}
}
-Layer::Layer() {
- type = LAYER_UNKNOWN;
- activation_type = ACT_UNKNOWN;
- last_layer = false;
- init_zero = false;
- activation = NULL;
- activation_prime = NULL;
- bn_follow = false;
- weight_decay.type = WeightDecayType::unknown;
- weight_decay.lambda = 0.0;
- weight_ini_type = WEIGHT_UNKNOWN;
-}
-
int Layer::setActivation(ActiType acti) {
int status = ML_ERROR_NONE;
if (acti == ACT_UNKNOWN) {