MCPcopy Create free account
hub / github.com/apple/ml-pointersect / __init__

Method __init__

cdslib/core/nn/modules/graves.py:198–219  ·  view source on GitHub ↗

Create an Alex Graves' model. Args: param_dict: A :py:class:`ParamGraves` object to define the hyper-parameters of the network. kwargs: If param_dict is None, you can directly provide keyword arguments of :py:class:`ParamGraves` here.

(self, param_dict: ParamGraves = None, **kwargs)

Source from the content-addressed store, hash-verified

196 """
197
198 def __init__(self, param_dict: ParamGraves = None, **kwargs):
199 """Create an Alex Graves' model.
200
201 Args:
202 param_dict:
203 A :py:class:`ParamGraves` object to define the hyper-parameters of the network.
204 kwargs:
205 If param_dict is None, you can directly provide keyword arguments of :py:class:`ParamGraves` here.
206 """
207 super().__init__()
208
209 # read and set configs
210 if param_dict is not None:
211 self.config_dict = ParamGraves(**param_dict)
212 else:
213 self.config_dict = ParamGraves(**kwargs)
214
215 for key in self.config_dict:
216 setattr(self, key, self.config_dict[key])
217
218 # construct sub-networks
219 self._construct_networks()
220
221 def _construct_networks(self):
222 """Construct the sub-networks.

Callers

nothing calls this directly

Calls 3

_construct_networksMethod · 0.95
ParamGravesClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected