smash.Model.get_nn_parameters_bias#
- Model.get_nn_parameters_bias()[source]#
Get the bias of the parameterization neural network.
- Returns:
- valuelist[
numpy.ndarray] A list of arrays representing the biases of trainable layers.
- valuelist[
See also
Model.nn_parametersThe weight and bias of the parameterization neural network.
Model.set_nn_parameters_biasSet the values of the bias in the parameterization neural network.
Examples
>>> from smash.factory import load_dataset >>> setup, mesh = load_dataset("cance")
Set the hydrological module to
'gr4_mlp'(hybrid hydrological model with multilayer perceptron)>>> setup["hydrological_module"] = "gr4_mlp"
Set the number of neurons in the hidden layer to 6 (the default value is 16, if not set)
>>> setup["hidden_neuron"] = 6 >>> model = smash.Model(setup, mesh)
By default, the biases of trainable layers are set to zero. Access to their values with the getter methods
get_nn_parameters_bias>>> model.get_nn_parameters_bias() [array([0., 0., 0., 0., 0., 0.], dtype=float32), array([0., 0., 0., 0.], dtype=float32)]
The output contains a list of bias values for trainable layers.