Describe the expected behaviorinit_from_dict() should return a propper object that will be assigned to an attribute of a NN layer.
Code to reproduce the issue
from numpy_ml.neural_nets.layers import *
c1 = Conv2D(6, (3,3))
opt = c1.hyperparameters['optimizer'] # dict
c2=Conv2D(6, (3,3), optimizer=opt) # The optimizer is set to None
c2.hyperparameters
This raises AttributeError: 'NoneType' object has no attribute 'cache'.
The same happens with Scheduler.
System information
Describe the current behavior When calling the
init_from_dict()
method from numpy_ml/neural_nets/initializers, from bothSchedulerInitializer
andOptimizerInitializer
classes, the returned object isNone
, rather than a propper object. This is caused by the assignation of theset_params()
method to the returned object. Such a method does not return an object but modifies the instance itself. https://github.com/ddbourgin/numpy-ml/blob/b537fac970f85d4919fe8c491499480a3a71bf8c/numpy_ml/neural_nets/initializers/initializers.py#L176-L194Describe the expected behavior
init_from_dict()
should return a propper object that will be assigned to an attribute of a NN layer.Code to reproduce the issue
This raises
AttributeError: 'NoneType' object has no attribute 'cache'
. The same happens withScheduler
.