Source code for deeppy.base

import cudarray as ca
import logging

logging.basicConfig(
    level=logging.INFO,
    format='%(levelname)-8s %(message)s',
)


bool_ = ca.bool_
int_ = ca.int_
float_ = ca.float_


[docs]class ParamMixin(object): @property def _params(self): """ List of Parameter objects. """ raise NotImplementedError() @_params.setter def _params(self, params): raise NotImplementedError()
[docs]class PhaseMixin(object): _phase = None @property def phase(self): return self._phase @phase.setter def phase(self, phase): self._phase = phase
[docs]class Model(ParamMixin): def _setup(self, **array_shapes): pass def _update(self, **arrays): raise NotImplementedError()
[docs]class PickleMixin(object): def __getstate__(self): return dict((k, None) if k.startswith('_tmp_') else (k, v) for k, v in self.__dict__.items())