cd_binary_binary: added gibbs sampling
This commit is contained in:
+4
-2
@@ -100,8 +100,10 @@ def cd_binary_binary(entity: Entity, data_pos: Mat, params: TrainingParams):
|
||||
data_neg = prob(entity.v_given_h(h_probs_pos))
|
||||
h_probs_neg = prob(entity.h_given_v(data_neg))
|
||||
|
||||
# Gibbs sampling with training params
|
||||
# ToDo
|
||||
# Gibbs sampling
|
||||
for _ in range(params.num_gibbs_samples-1):
|
||||
data_neg = prob(entity.v_given_h(h_probs_neg))
|
||||
h_probs_neg = prob(entity.h_given_v(data_neg))
|
||||
|
||||
# Update weights (negative phase)
|
||||
dw -= np.dot(np.transpose(data_neg), h_probs_neg)
|
||||
|
||||
Reference in New Issue
Block a user