arbitragelab.ml_approach.neural_networks
This module implements the Multi Layer Perceptron, RNN model and the Pi Sigma Model described in Dunis et al. (2005).
Module Contents
Classes
Skeleton Class to be inherited by child neural network implementations. |
|
Vanilla Multi Layer Perceptron implementation. |
|
Recurrent Neural Network implementation. |
|
Pi Sigma Neural Network implementation. |
- class BaseNeuralNetwork
Skeleton Class to be inherited by child neural network implementations.
- fit(*args, **kwargs)
Wrapper over the keras model fit function.
- Returns:
(History) Fitted model.
- predict(*args, **kwargs)
Wrapper over the keras model predict function.
- plot_loss()
Method that returns visual plot of the loss trajectory in terms of epochs spent training.
- class MultiLayerPerceptron(frame_size: int, hidden_size: int = 2, num_outputs: int = 1, loss_fn: str = 'mean_squared_error', optmizer: str = 'adam', metrics: str = 'accuracy', hidden_layer_activation_function: str = 'relu', output_layer_act_func: str = 'linear')
Bases:
BaseNeuralNetwork
Vanilla Multi Layer Perceptron implementation.
- build()
Builds and compiles model architecture.
- Returns:
(Model) Resulting model.
- fit(*args, **kwargs)
Wrapper over the keras model fit function.
- Returns:
(History) Fitted model.
- predict(*args, **kwargs)
Wrapper over the keras model predict function.
- plot_loss()
Method that returns visual plot of the loss trajectory in terms of epochs spent training.
- class RecurrentNeuralNetwork(input_shape: tuple, hidden_size: int = 10, num_outputs: int = 1, loss_fn: str = 'mean_squared_error', optmizer: str = 'adam', metrics: str = 'accuracy', hidden_layer_activation_function: str = 'relu', output_layer_act_func: str = 'linear')
Bases:
BaseNeuralNetwork
Recurrent Neural Network implementation.
- build()
Builds and compiles model architecture.
- Returns:
(Model) Resulting model.
- fit(*args, **kwargs)
Wrapper over the keras model fit function.
- Returns:
(History) Fitted model.
- predict(*args, **kwargs)
Wrapper over the keras model predict function.
- plot_loss()
Method that returns visual plot of the loss trajectory in terms of epochs spent training.
- class PiSigmaNeuralNetwork(frame_size: int, hidden_size: int = 2, num_outputs: int = 1, loss_fn: str = 'mean_squared_error', optmizer: str = 'sgd', metrics: str = 'accuracy', hidden_layer_activation_function: str = 'linear', output_layer_act_func: str = 'sigmoid')
Bases:
BaseNeuralNetwork
Pi Sigma Neural Network implementation.
- build()
Builds and compiles model architecture.
- Returns:
(Model) Resulting model.
- fit(*args, **kwargs)
Wrapper over the keras model fit function.
- Returns:
(History) Fitted model.
- predict(*args, **kwargs)
Wrapper over the keras model predict function.
- plot_loss()
Method that returns visual plot of the loss trajectory in terms of epochs spent training.