Skip to content
Snippets Groups Projects
Commit 90fa434e authored by Daniel Povey's avatar Daniel Povey
Browse files

Merge pull request #153 from keli78/test1

Modified virtual functions Scale and Add 
parents cb05ff96 8d929ff5
No related branches found
No related tags found
No related merge requests found
......@@ -310,14 +310,14 @@ class Component {
// -- an UpdatableComponent scales the parameters
/// by "scale" when called by an UpdatableComponent.
// -- a NonLinear component it relates to scaling activation stats, not parameters.
virtual void Scale(BaseFloat scale) = 0;
virtual void Scale(BaseFloat scale) {};
/// This virtual function when called by
// -- an UpdatableComponent adds the parameters of
/// another updatable component, times some constant, to the current
/// parameters.
// -- a NonlinearComponent it relates to adding stats
virtual void Add(BaseFloat alpha, const Component &other) = 0;
virtual void Add(BaseFloat alpha, const Component &other) {};
Component() { }
......
......@@ -66,10 +66,6 @@ class PnormComponent: public Component {
virtual Component* Copy() const { return new PnormComponent(input_dim_,
output_dim_); }
virtual void Scale(BaseFloat scale) {};
virtual void Add(BaseFloat alpha, const Component &other) {};
virtual void Read(std::istream &is, bool binary); // This Read function
// requires that the Component has the correct type.
......@@ -109,8 +105,6 @@ class ElementwiseProductComponent: public Component {
virtual Component* Copy() const { return new ElementwiseProductComponent(input_dim_,
output_dim_); }
virtual void Scale(BaseFloat scale) {};
virtual void Add(BaseFloat alpha, const Component &other) {};
virtual void Read(std::istream &is, bool binary); // This Read function
// requires that the Component has the correct type.
......@@ -505,8 +499,6 @@ class FixedAffineComponent: public Component {
virtual Component* Copy() const;
virtual void Scale(BaseFloat scale) {};
virtual void Add(BaseFloat alpha, const Component &other) {};
virtual void Read(std::istream &is, bool binary);
virtual void Write(std::ostream &os, bool binary) const;
......@@ -550,8 +542,6 @@ public:
Component *to_update,
CuMatrixBase<BaseFloat> *in_deriv) const;
virtual Component* Copy() const;
virtual void Scale(BaseFloat scale) {};
virtual void Add(BaseFloat alpha, const Component &other) {};
virtual void Read(std::istream &is, bool binary);
virtual void Write(std::ostream &os, bool binary) const;
......@@ -599,8 +589,6 @@ class FixedScaleComponent: public Component {
Component *, // to_update
CuMatrixBase<BaseFloat> *in_deriv) const;
virtual Component* Copy() const;
virtual void Scale(BaseFloat scale) {};
virtual void Add(BaseFloat alpha, const Component &other) {};
virtual void Read(std::istream &is, bool binary);
virtual void Write(std::ostream &os, bool binary) const;
......@@ -643,8 +631,6 @@ class FixedBiasComponent: public Component {
Component *, // to_update
CuMatrixBase<BaseFloat> *in_deriv) const;
virtual Component* Copy() const;
virtual void Scale(BaseFloat scale) {};
virtual void Add(BaseFloat alpha, const Component &other) {};
virtual void Read(std::istream &is, bool binary);
virtual void Write(std::ostream &os, bool binary) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment