Bias renamed and Model IO / Config module parameters

This commit is contained in:
Si11ium
2020-04-27 17:31:29 +02:00
parent 8497857a57
commit 3e75d73a6b
6 changed files with 35 additions and 14 deletions

View File

@ -66,6 +66,7 @@ class Config(ConfigParser, ABC):
@property
def project(self):
return self._get_namespace_for_section('project')
###################################################
@property

View File

@ -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,