smash.factory.Net.get_bias#

Net.get_bias()[source]#

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

Returns:
valuelist[numpy.ndarray]

A list of numpy arrays containing the biases of the trainable layers.

See also

Net.set_bias

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

Examples

>>> from smash.factory import Net
>>> net = Net()
>>> net.add_dense(2, input_shape=3, bias_initializer="normal")
>>> net
+----------------------------------------------------------+
| Layer Type            Input/Output Shape  Num Parameters |
+----------------------------------------------------------+
| Dense                 (3,)/(2,)           8              |
+----------------------------------------------------------+
Total parameters: 8
Trainable parameters: 8

Set random biases

>>> net.set_bias(random_state=0)

Get the bias values

>>> net.get_bias()
[array([[0.01764052, 0.00400157]])]