Adding layers to a model in OPE Prop
A layer in Deep Learning is what does all of the forward-propagation mathematics. A layer consists of units which aren't together, but rather are a collection that do independent calculations based on the previous inputs. The unit outputs are then collected to an array by the layer, which then passes them as inputs into the next layer.
A layer is represented by the class UnitLayer, and can be instantiated by the following:
OPEProp::UnitLayer.new number_of_units
After creating a layer, you can add it to a model with
model.add_layer layer
Or in a form, without creating a variable for the unit layer:
model.add_layer OPEProp::Layer.new(number_of_units)
You can add as many layers to a model as you'd like. For example:
model.add_layer OPEProp::Layer.new(10) model.add_layer OPEProp::Layer.new(5) model.add_layer OPEProp::Layer.new(1)
will add three layers to a model, with their varying number of units.
After adding layers to your model, you will need to compile it, connecting all of the layers together. Learn about compiling the model here.