class documentation
A simple sequential model with multiple layers one after the other
This is the simplest model type that is commonly used. It has multiple layers in it sequentially connected by dense connected directed graph between neurons.
Method | __init__ |
Initialize the required attributes. |
Method | add |
Method to add layers to the model |
Method | compile |
Method to initialize and compile the model |
Method | evaluate |
Method to evaluate the model with test data |
Method | fit |
Method to train the model and fit the data |
Method | predict |
Method to predict data labels |
Method | save |
Method to save the model to disk |
Method | summary |
Prints a summary of the model once compiled |
Instance Variable | callbacks |
A list of callback functions |
Instance Variable | epochs |
Number of epochs to train for |
Instance Variable | has |
Boolean flag fo if the the model has validation data |
Instance Variable | is |
Has the model been compiled |
Instance Variable | learning |
The learning rate of the model |
Instance Variable | loss |
The loss function used by the model |
Instance Variable | loss |
The name of the loss function used |
Instance Variable | train |
The feature list of the dataset |
Instance Variable | train |
The labels for each data in the dataset |
Instance Variable | validation |
Features of validation set |
Instance Variable | validation |
Labels of the validation set |
Inherited from BaseModel
:
Method | stop |
Method to stop the training |
Instance Variable | accuracy |
The accuracy value of the model at any instance |
Instance Variable | current |
The current epoch of the model during training |
Instance Variable | error |
The loss value of the model at any instance |
Instance Variable | is |
Is the model training right now |
Instance Variable | layers |
A list of layers in the model |
Instance Variable | metrics |
A dictionary of metrics for the model. Includes loss, acc, val_loss, val_acc |
Instance Variable | parameters |
Amount of trainable parameters in the model |
Instance Variable | test |
Features of the test dataset |
Instance Variable | test |
Labels for the test dataset |
Instance Variable | weights |
A list of all weights between each layers |
Initialize the required attributes.
Also optionally takes in a list of layers as a parameter.
- Keyword Args
- layers: It takes a list of layers and them to the model
def compile(self, loss:
str
, learning_rate: float
= 0.001, verbose: bool
= False, **kwargs):
(source)
¶
Method to initialize and compile the model
Initializes all the required values and performs required operations.
- Args
- loss:
- The loss function to use. Available => mean_squared_error
- learning_rate:
- The learning_rate to use while fitting data
- verbose:
- Should progress be displayed in details
Method to evaluate the model with test data
- Args
- x_data:
- The features of the dataset
- y_data:
- The label of the dataset
- Keyword Args
- is_validation: Whether the model is called during validation set checking step of training
Method to train the model and fit the data
It runs the training where the network does the learning.
- Args
- train_x:
- The features of the dataset
- train_y:
- The label of the dataset
- epochs:
- The number of steps to run the training for
- Keyword Args
- validation_x: validation data set features validation_y: validation data set labels callbacks: A list of callback methods
Method to predict data labels
- Args
- input_x:
- The features of the data to predict
- Returns
- The final output layer with the generated values
Method to save the model to disk
- Args
- save_path:
- Path to where the model will be saved, along with the name of the model file