aabf7385ce8ac1f6c3f3b7a5d25e7cabdfb60114
Rbm::train had mini-batch chunks as the outer loop and epochs as the inner loop: each fixed, never-reshuffled slice of the data got all numEpochs gradient steps back-to-back before ever being revisited, so "numEpochs" didn't mean "passes over the whole dataset" and training was biased toward whatever data came last. Invert the nesting (epochs outer, mini-batches inner, batch reshuffled via arma::shuffle at the start of each epoch) so every epoch is an actual full pass over the data in a fresh random order. Also drop a redundant toHiddenProbs(v_states) call in cd_jens: the positive-phase hidden probabilities were computed once unconditionally and then discarded, recomputed a second time with identical input in two of the three sampling branches. Same result, half the cost, on every mini-batch of every epoch of every layer. Both only affect training; inference (step_forward/generation) is unchanged, confirmed by identical poet.elf f output before and after. 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%