train: fixed gaussian sampling
This commit is contained in:
+3
-2
@@ -97,7 +97,7 @@ def cd_gaussian_binary(entity: Entity, data_pos: Mat):
|
|||||||
|
|
||||||
# Positive phase
|
# Positive phase
|
||||||
if params.do_batch_sample:
|
if params.do_batch_sample:
|
||||||
h_probs_pos = entity.h_given_v(sample_gaussian(data_pos))
|
h_probs_pos = entity.h_given_v(data_pos + sample_gaussian(data_pos))
|
||||||
else:
|
else:
|
||||||
h_probs_pos = entity.h_given_v(data_pos)
|
h_probs_pos = entity.h_given_v(data_pos)
|
||||||
|
|
||||||
@@ -126,10 +126,11 @@ def cd_gaussian_gaussian(entity: Entity, data_pos: Mat):
|
|||||||
|
|
||||||
# Positive phase
|
# Positive phase
|
||||||
if params.do_batch_sample:
|
if params.do_batch_sample:
|
||||||
h_probs_pos = entity.h_given_v(sample_gaussian(data_pos))
|
h_probs_pos = entity.h_given_v(data_pos + sample_gaussian(data_pos))
|
||||||
else:
|
else:
|
||||||
h_probs_pos = entity.h_given_v(data_pos)
|
h_probs_pos = entity.h_given_v(data_pos)
|
||||||
|
|
||||||
|
if not params.do_rao_blackwell:
|
||||||
# Sample hidden states
|
# Sample hidden states
|
||||||
h_probs_pos += sample_gaussian(h_probs_pos)
|
h_probs_pos += sample_gaussian(h_probs_pos)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user