Пример #1
0
 def __init__(self, input_dim, active_dims=None):
     Parameterized.__init__(self)
     self.input_dim = input_dim
     if active_dims is None:
         self.active_dims = slice(input_dim)
     else:
         self.active_dims = active_dims
Пример #2
0
 def __init__(self, input_dim, active_dims=None):
     Parameterized.__init__(self)
     self.input_dim = input_dim
     if active_dims is None:
         self.active_dims = slice(input_dim)
     else:
         self.active_dims = active_dims
Пример #3
0
 def __init__(self, name='model'):
     """
     name is a string describing this model.
     """
     Parameterized.__init__(self)
     self._name = name
     self._needs_recompile = True
     self._session = tf.Session()
     self._free_vars = tf.placeholder(tf.float64)
Пример #4
0
 def __init__(self, input_dim, active_dims=None):
     """
     input dim is an integer
     active dims is a (slice | iterable of integers | None)
     """
     Parameterized.__init__(self)
     self.input_dim = input_dim
     if active_dims is None:
         self.active_dims = slice(input_dim)
     else:
         self.active_dims = tf.constant(np.array(active_dims, dtype=np.int32), tf.int32)
Пример #5
0
 def __getstate__(self):
     """
     This mehtod is necessary for pickling objects
     """
     d = Parameterized.__getstate__(self)
     d.pop('_session')
     d.pop('_free_vars')
     try:
         d.pop('_objective')
         d.pop('_minusF')
         d.pop('_minusG')
     except:
         pass
     return d
Пример #6
0
 def __init__(self):
     Parameterized.__init__(self)
     self.num_gauss_hermite_points = 20
Пример #7
0
 def __setstate__(self, d):
     Parameterized.__setstate__(self, d)
     self._needs_recompile = True
     self._session = tf.Session()