added model
This commit is contained in:
+6
-3
@@ -2,10 +2,10 @@ from .state import RbmState
|
||||
from .matrix import prob, Mat
|
||||
|
||||
class EntityParams:
|
||||
def __init__(self):
|
||||
def __init__(self, do_gaussian_visible: bool = False, do_gaussian_hidden: bool = False):
|
||||
# Entity parameters
|
||||
self.do_gaussian_visible = False
|
||||
self.do_gaussian_hidden = False
|
||||
self.do_gaussian_visible = do_gaussian_visible
|
||||
self.do_gaussian_hidden = do_gaussian_hidden
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, params: dict):
|
||||
@@ -24,6 +24,9 @@ class Entity:
|
||||
self.state = RbmState.from_layer_params(shape)
|
||||
self.grad = RbmState.from_layer_params(shape)
|
||||
|
||||
def __call__(self, x: Mat):
|
||||
return self.forward(x)
|
||||
|
||||
def grad_zero(self):
|
||||
self.grad = RbmState.from_layer_params(self.shape)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user