Intro to NN
NN acts as a skeleton which keeps your Layers in place.
You can create a model without using this class by implementing custom logic.
Usage
Methods
add
Use this to add new Layer to your model
forward
Forward your neural network single step. You can use this function to make predictions
train
Use this function to train your model.
- Epochs: Amount of time the model will see your data,
- Alpha: Learning Rate,
- Verbose: If set to true, prints epoch number and accuracy,
- Loss: Used to calculate loss, which is then used to calculate accuracy,
- Optimizer: Element which optimizes your model
explain
Returns the explanation of possibly what’s going on under the hood based on the x passed.
save
Saves the model to the specified file path. The name of file will be modelName.json
, where name is name of the model defined when creating the object.
load
Loads the model from specified file path.
Properties
structure
Returns Layer’s configuration in form of a String
layers
Returns array of layers