Commit Graph
12 Commits
Author SHA1 Message Date
jensandClaude Sonnet 5 ca27e1e705 Route project files through prj/<name>/ instead of flat at repo root
Repo root had ~35 groups of .prj/.dat files loose alongside the build
system and source, all sharing one flat namespace. Centralize the new
prj/<name>/ convention inside AStack::loadWeights/saveWeights/
loadTrainingBatch/saveTrainingBatch and StackCreator::fromFile/toFile
(via a new AStack::projectDir() helper) -- these already have access to
the project name, so callers (poet.cpp, the GUI) need no changes at all;
they keep passing the same base directory they always did.

Filenames inside each project folder are unchanged (e.g.
prj/mnist_2/mnist_2.prj, prj/mnist_2/mnist_2.Layer.0.w.dat) -- only the
directory moves. Added Matutils::ensureDir() (mkdir -p equivalent; no
std::filesystem in C++11) since ofstream won't create directories, used
wherever a project is saved for the first time.

File migration for existing projects is a separate commit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016K8Gu7Qejd11JbdiHZqYAs
2026-07-27 14:41:05 +02:00
jensandClaude Sonnet 5 eb29e33b81 Fix Bernoulli-only sample() applied to Gaussian visible/hidden units
Matutils::sample() always binary-thresholds (src > uniform(src)), but it
was the only sampler in the codebase and was called unconditionally on
h_probs/v_probs/miniBatch in several CD Gibbs-loop branches regardless
of doGaussianVisible/doGaussianHidden. Binary-thresholding a Gaussian
unit's continuous activation is meaningless -- it would corrupt any
Gaussian-visible/hidden RBM (image-domain experiments via the GUI or
TEST target); doesn't affect poet's plain BB-RBM path since both flags
are false there.

Add sample_gaussian() (mean + N(0,1) noise) alongside the existing
Bernoulli sample() in matutils.hpp, plus Rbm::sampleVisible/sampleHidden
helpers that dispatch to the right one per the RBM's configured type.
Replace every visible/hidden Gibbs-step sample() call in cd_jens (the
active path) and cd_hinton (compiled but currently unused, behind
USE_CD_HINTON) with the appropriate dispatch helper, and fix the same
issue in Rbm::train's doSampleBatch path.

Behavior is unchanged for any RBM with doGaussianVisible/doGaussianHidden
both false (confirmed: poet.elf f output identical before/after).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016K8Gu7Qejd11JbdiHZqYAs
2026-07-27 13:45:03 +02:00
jens 5321e01cca - improved cd_hinton()
- uniform() returns vector
2024-02-01 19:03:13 +01:00
jens 2a2be76b2c - AStack:Load show mean and stddev 2024-01-31 12:20:15 +01:00
jens 285be92cdb - finally return normalized data 2024-01-31 11:40:41 +01:00
jens c0445f3bf8 - moved Rbm:prob() to Matutils::prob()
- Matutils::Normalize uses prob()
2024-01-29 13:04:13 +01:00
jens a5ed0be991 - added original implementation for binary RBM 2024-01-24 18:41:42 +01:00
jens fb5ac6d124 Fixed normalization 2024-01-24 14:44:20 +01:00
jens 4a7fcb387c - fixed normalization
- added sigmoid after normalization
2024-01-23 21:05:13 +01:00
jens 4a16926030 - improved training data normalization 2024-01-22 19:53:12 +01:00
jens 97c9dcce7c - added char2vec and vec2char
- refactored

git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@859 b431acfa-c32f-4a4a-93f1-934dc6c82436
2022-01-21 15:27:30 +00:00
jens aef3049856 - refactored common functions into matutils
git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@855 b431acfa-c32f-4a4a-93f1-934dc6c82436
2022-01-21 07:46:40 +00:00