berry.BerryModel

Helper class for constructing a neural network model using Berry

class braid.berry.BerryModel

Helper class to create deep neural networks using Berry.

berry.BerryModel maintains an ordered dictionary of layers added to the graph and provides access to the output of the model. It also provides easy access to auxiliary variables and the values taken by them during ‘train’ and ‘test’ phase.

layers
: ordered dict
All the layers which have been added to the graph. “Key” is the name of the added object and the “value” is the object. Object can either be of berry.layers.Layer class or tf.Tensor class.
last
: berry.layers.Layer or tf.Tensor
The last layer added to the model.
output
: tf.Tensor
The output tensor of the last layer added to the model.
train_aux
: dict
Contains the auxiliary inputs for the model. The “key” is the name of the auxiliary variables and the “value” is the value taken by the variable during the training phase.
test_aux
: dict
Contains the auxiliary inputs for the model. The “key” is the name of the auxiliary variables and the “value” is the value taken by the variable during the testing phase.
add(layer_instance)

Add another layer to the model.

layer_instance
: Layer or tf.Tensor
Insert the layer to the dict of layers, self.layers.
get(layer_name)

Get an existing layer from the model.

layer_name
: string
Name of the layer.
Layer
The layer corresponding to the name, layer_name.
last
layers
output
test_aux
train_aux