4cf5f1555506a84bc1b21e6a8c24fffddc3c0c0d
doGaussianHidden took priority over doRaoBlackwell when deciding h_states for the positive-phase gradient, so a Gaussian-hidden RBM always got the noisy sample (h_probs + randn) for dw/dbh even with doRaoBlackwell set -- ignoring the flag and adding avoidable gradient variance. Standard CD practice (and pyRBM's cd_gaussian_gaussian) uses the mean for the weight/bias gradient when Rao-Blackwellizing, regardless of unit type. Reordered so doRaoBlackwell is checked first (mean, any unit type) and only samples otherwise, dispatching via the sampleHidden() helper added in the previous commit so Gaussian/binary hidden units are each sampled correctly. Behavior-preserving for poet (doRaoBlackwell=true, doGaussianHidden=false already took the mean branch); only changes behavior for a Gaussian-hidden RBM trained with doRaoBlackwell enabled. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016K8Gu7Qejd11JbdiHZqYAs
Description
No description provided
144 MiB
Languages
C++
92.6%
C
4.2%
Makefile
2.8%
Shell
0.4%