smash.factory.Net#

class smash.factory.Net[source]#

Artificial Neural Network initialization.

Attributes:
history

A dictionary saving training information.

layers

List of Layer objects defining the graph of the network.

Methods

add_conv2d(filters, filter_shape[, ...])

Add a 2D convolutional layer (with same padding and a stride of one) to the neural network.

add_dense(neurons[, input_shape, ...])

Add a fully-connected layer to the neural network.

add_dropout(drop_rate)

Add a dropout layer that randomly sets the output of the previous layer to zero with a specified probability.

add_flatten()

Add a flatten layer to reshape the input from 2D layer into 1D layer.

add_scale(bounds)

Add a scaling layer that applies the min-max scaling function to the outputs.

copy()

Make a deepcopy of the Net.

forward_pass(x)

Perform a forward pass through the neural network.

get_bias()

Get the biases of the trainable layers of the neural network Net.

get_weight()

Get the weights of the trainable layers of the neural network Net.

set_bias([value, random_state])

Set the values of the bias in the neural network Net.

set_trainable(trainable)

Method which enables to train or freeze the weights and biases of the network's layers.

set_weight([value, random_state])

Set the values of the weight in the neural network Net.

Examples

>>> from smash.factory import Net
>>> net = Net()
>>> net
+------------------------------------------------+
| Layer Type  Input/Output Shape  Num Parameters |
+------------------------------------------------+
Total parameters: 0
Trainable parameters: 0