Bias renamed and Model IO / Config module parameters
This commit is contained in:
@ -66,6 +66,7 @@ class Config(ConfigParser, ABC):
|
||||
@property
|
||||
def project(self):
|
||||
return self._get_namespace_for_section('project')
|
||||
|
||||
###################################################
|
||||
|
||||
@property
|
||||
|
@ -10,6 +10,21 @@ from torch import nn
|
||||
# Hyperparamter Object
|
||||
class ModelParameters(Mapping, Namespace):
|
||||
|
||||
@property
|
||||
def module_paramters(self):
|
||||
paramter_mapping = dict()
|
||||
paramter_mapping.update(self.model_param.__dict__)
|
||||
|
||||
paramter_mapping.update(
|
||||
dict(
|
||||
activation=self._activations[paramter_mapping['activation']]
|
||||
)
|
||||
)
|
||||
|
||||
del paramter_mapping['in_shape']
|
||||
|
||||
return paramter_mapping
|
||||
|
||||
def __getitem__(self, k):
|
||||
# k: _KT -> _VT_co
|
||||
return self.__dict__[k]
|
||||
@ -22,6 +37,10 @@ class ModelParameters(Mapping, Namespace):
|
||||
# -> Iterator[_T_co]
|
||||
return iter(list(self.__dict__.keys()))
|
||||
|
||||
def __delitem__(self, key):
|
||||
self.__dict__.__delitem__(key)
|
||||
return True
|
||||
|
||||
_activations = dict(
|
||||
leaky_relu=nn.LeakyReLU,
|
||||
relu=nn.ReLU,
|
||||
|
Reference in New Issue
Block a user