Commit Graph
111 Commits
Author SHA1 Message Date
jensandClaude Sonnet 4.6 feaf96417a [faces_sub_image] - add --load_model and --do_train CLI args
Reconstruction always runs. Default: load saved weights, skip training.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 15:25:22 +02:00
jensandClaude Sonnet 4.6 56f881d155 [README] - add faces_sub_image test entry
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 15:21:46 +02:00
jensandClaude Sonnet 4.6 441354088f [faces_sub_image] - add GB-RBM autoencoder test on Caltech WebFaces using SubImage ROIs
Extracts non-overlapping 32x32 RGB patches from face images using SubImage,
trains a GB-RBM (3072 visible, 128 hidden), and visualises learned filters,
patch reconstructions, and full image reconstruction.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 15:20:21 +02:00
jensandClaude Sonnet 4.6 7bbacc729b [README] - document all bug fixes in implementation notes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 14:47:23 +02:00
jensandClaude Sonnet 4.6 7d48f835a6 [bugfix] - fix momentum reset, cd_gaussian_gaussian noise, rms_error, label CuPy compat
- train.py: grad_zero() was called inside the epoch loop, resetting momentum
  to zero before every update — momentum had no effect in the default full-batch
  case. Moved outside the loop so momentum accumulates across epochs.
- train.py: cd_gaussian_gaussian: use mean h for weight updates and sampled h
  to drive the negative visible reconstruction (same pattern as cd_gaussian_binary fix).
  Remove spurious Gaussian noise added to data_neg before computing h_probs_neg.
- matrix.py: rms_error divided by d_err_squared[1] (row 1) instead of
  d_err_squared.shape[1] (column count).
- label.py: _dec_binary used reversed() on a CuPy array — replaced with np.flip().
  label2vec_onehot now returns np.stack() array instead of a Python list.
  vec2label_onehot implemented via np.argmax (was returning None).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 14:46:45 +02:00
jensandClaude Sonnet 4.6 f0e98eb714 [README] - document cd_gaussian_binary bug fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 14:37:27 +02:00
jensandClaude Sonnet 4.6 07e430f109 [cd_gaussian_binary] - fix negative phase: remove spurious noise, sample hidden states
In cd_gaussian_binary, two CD formulation bugs:
1. Gaussian noise was incorrectly added to data_neg before computing h_probs_neg
2. Negative visible reconstruction used h_probs_pos (soft probabilities) instead
   of sampled binary hidden states, biasing the fantasy particle toward the mean

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 14:36:18 +02:00
jensandClaude Sonnet 4.6 3c85705d85 [README] - add gaussian_autoencoder test entry
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 14:29:25 +02:00
jensandClaude Sonnet 4.6 b032db3099 [gaussian_autoencoder] - add GB-RBM autoencoder test with Gaussian blob data
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 14:28:57 +02:00
jensandClaude Sonnet 4.6 86d39813cd [binary_autoencoder] - add BB-RBM autoencoder test and tests README
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 14:24:49 +02:00
jensandClaude Sonnet 4.6 95be9dd632 [conv2d] - add 2D convolution function and test
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 10:11:11 +02:00
jens 92afc16137 [SubImage]
- handle different image shapes
2026-01-11 11:21:42 +01:00
jens be64b0f8ce refactored 2026-01-10 16:46:27 +01:00
jens 1722a68b2a [entity]
- refactored training parameters for grad_compute()
- added l1-norm
- improved tests
2026-01-10 15:21:40 +01:00
jens f7e3693f45 - added image module with sub image and normalize
- improved tests
2026-01-10 14:12:29 +01:00
jens b6a511e33c improved tests 2026-01-10 10:24:50 +01:00
jens f1aae9b0f1 [train]
- reset grad at start of epoch
[state]
- init(): set default parameter mu=0
2026-01-10 10:19:30 +01:00
jens 381ec8d0e3 improved tests 2026-01-09 15:28:53 +01:00
jens 4c939cab8b cd_gaussian_binary: no sampling of training data 2026-01-09 15:28:06 +01:00
jens 074ded1581 improved tests 2026-01-06 21:51:28 +01:00
jens 9025f54434 simplified EntityParams.from_dict 2026-01-06 21:49:35 +01:00
jens e7b287e632 - simplified TrainingParams.from_dict
- fixed test_rbm
2026-01-06 21:48:09 +01:00
jens 226453c7ae fixed status indention 2026-01-06 21:06:11 +01:00
jens 7d3ab02e26 fixed dividing l2-norm by length of vector 2026-01-06 18:17:45 +01:00
jens 542b8ae9b0 added L2-Regulation 2026-01-06 18:00:26 +01:00
jens ff6254a15d - Status has entity paarmeter
- train provides entity parameter to Status
2026-01-06 11:29:47 +01:00
jens 42520e5761 improved tests 2026-01-06 09:44:45 +01:00
jens ec5d259ff7 Entity: added property enable training 2026-01-06 09:44:29 +01:00
jens 74138b5514 train: swapped epochs and mini-batch loop 2026-01-05 20:53:31 +01:00
jens d238d2954e grad_compute(): pre-multiply weight decay with learning rate 2026-01-05 19:40:05 +01:00
jens fdf4186d6b significantly improved GB-RBM training 2026-01-05 14:16:34 +01:00
jens 9f72c1f253 - added cifar_test as jupiter lab
- started torch version of RBM
- enable CUDA in matrix
2026-01-04 18:30:01 +01:00
jens 73d4486fb7 test_norbs: added mode hidden gaussian - hidden binary 2026-01-04 16:06:41 +01:00
jens 6546c37657 train: fixed gaussian sampling 2026-01-03 19:30:47 +01:00
jens e6c959d890 - fixed test_xor
- added test_linear
2026-01-03 13:07:08 +01:00
jens e56f99535a improved tests 2026-01-03 12:51:43 +01:00
jens 529252166a train: sample gaussian visible units 2026-01-03 12:40:08 +01:00
jens f828c26f36 refactored 2026-01-03 12:10:53 +01:00
jens 94595ddd8a train: added cd_binary_gaussian 2026-01-03 12:10:17 +01:00
jens fa9f595be6 use gray color map 2026-01-02 22:50:03 +01:00
jens 082bb3c566 Label: added OneHote encoding 2026-01-02 22:49:00 +01:00
jens 2e714685d1 model: forward() is not abstract method 2026-01-02 19:42:22 +01:00
jens c87b8f8ed0 fixed 2026-01-02 19:41:26 +01:00
jens 48f3642e44 fixed TrainingParams 2026-01-02 18:36:17 +01:00
jens c7f820ec63 - adapted test to TrainingParameter as parat of Entity
- learn_norbs_labes start working
2026-01-02 14:53:45 +01:00
jens 10691894d1 - training params are (again) attrubute of Entity
- ditched layout concept
2026-01-02 14:51:19 +01:00
jens 8b97350564 cd_binary_binary: added gibbs sampling 2026-01-01 20:02:22 +01:00
jens e67207504b fixed cd_binary_binary 2026-01-01 15:55:35 +01:00
jens dc998d30a2 - initroduced types: BB-RBM GB-RBM, GG-RBM as property of entity
- training simplification and for clarity: added specialized cd_funcs for each entity type
2026-01-01 12:05:39 +01:00
jens 38b834c640 - added training params as list for model.train()
- added gaussian sample
- introduced layout concept
- updated README
2025-12-31 16:13:59 +01:00