exarl.candlelib.keras_utils
Module Contents
Classes
Functions
Set the number of parallel threads according to the number available on the hardware |
|
|
Set the random number seed to the desired value |
|
|
|
Set the optimizer to the appropriate Keras optimizer function |
|
Set the initializer to the appropriate Keras initializer function |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- exarl.candlelib.keras_utils.set_parallelism_threads()
Set the number of parallel threads according to the number available on the hardware
- exarl.candlelib.keras_utils.set_seed(seed)
Set the random number seed to the desired value
- Parameters
seed (integer) – Random number seed.
- exarl.candlelib.keras_utils.get_function(name)
- exarl.candlelib.keras_utils.build_optimizer(type, lr, kerasDefaults)
Set the optimizer to the appropriate Keras optimizer function based on the input string and learning rate. Other required values are set to the Keras default values
- Parameters
type (string) –
String to choose the optimizer
Options recognized: ‘sgd’, ‘rmsprop’, ‘adagrad’, adadelta’, ‘adam’ See the Keras documentation for a full description of the options
lr (float) – Learning rate
kerasDefaults (list) – List of default parameter values to ensure consistency between frameworks
- Returns
The appropriate Keras optimizer function
- exarl.candlelib.keras_utils.build_initializer(type, kerasDefaults, seed=None, constant=0.0)
Set the initializer to the appropriate Keras initializer function based on the input string and learning rate. Other required values are set to the Keras default values
- Parameters
type (string) –
String to choose the initializer
Options recognized: ‘constant’, ‘uniform’, ‘normal’, ‘glorot_uniform’, ‘lecun_uniform’, ‘he_normal’
See the Keras documentation for a full description of the options
kerasDefaults (list) – List of default parameter values to ensure consistency between frameworks
seed (integer) – Random number seed
constant (float) – Constant value (for the constant initializer only)
- Returns
The appropriate Keras initializer function
- exarl.candlelib.keras_utils.build_loss(loss_type, kerasDefaults, reduction='auto')
- exarl.candlelib.keras_utils.xent(y_true, y_pred)
- exarl.candlelib.keras_utils.r2(y_true, y_pred)
- exarl.candlelib.keras_utils.mae(y_true, y_pred)
- exarl.candlelib.keras_utils.mse(y_true, y_pred)
- exarl.candlelib.keras_utils.covariance(x, y)
- exarl.candlelib.keras_utils.corr(y_true, y_pred)
- exarl.candlelib.keras_utils.evaluate_autoencoder(y_pred, y_test)
- class exarl.candlelib.keras_utils.PermanentDropout(rate, **kwargs)
Bases:
tensorflow.keras.layers.Dropout- call(self, x, mask=None)
- exarl.candlelib.keras_utils.register_permanent_dropout()