fixed contamination of function parameter
This commit is contained in:
+8
-8
@@ -76,18 +76,18 @@ class Entity:
|
||||
|
||||
|
||||
def gibbs_v_to_h(self, v: np.ndarray) -> np.ndarray:
|
||||
h = None
|
||||
for i in range(self.params.num_gibbs_samples):
|
||||
h = self.v_to_ph(v)
|
||||
v = self.h_to_pv(h)
|
||||
h = self.v_to_ph(v)
|
||||
for i in range(self.params.num_gibbs_samples-1):
|
||||
h = self.h_to_pv(h)
|
||||
h = self.v_to_ph(h)
|
||||
|
||||
return h
|
||||
|
||||
def gibbs_h_to_v(self, h: np.ndarray) -> np.ndarray:
|
||||
v = None
|
||||
for i in range(self.params.num_gibbs_samples):
|
||||
v = self.h_to_pv(h)
|
||||
h = self.v_to_ph(v)
|
||||
v = self.h_to_pv(h)
|
||||
for i in range(self.params.num_gibbs_samples-1):
|
||||
v = self.v_to_ph(v)
|
||||
v = self.h_to_pv(v)
|
||||
|
||||
return v
|
||||
|
||||
|
||||
Reference in New Issue
Block a user