Mercurial > hg > jslab
annotate src/scheme/newica.scm @ 8:5e3cbbf173aa tip
Reorganise some more
author | samer |
---|---|
date | Fri, 05 Apr 2019 22:41:58 +0100 |
parents | bf79fb79ee13 |
children |
rev | line source |
---|---|
samer@0 | 1 (import "samer.models.*") |
samer@0 | 2 |
samer@0 | 3 (define (newica x) |
samer@0 | 4 (define ica (ICA. x)) |
samer@0 | 5 (define scaler (DiffScaler. (.output ica))) |
samer@0 | 6 (define genexp (GeneralisedExponential. (.output scaler))) |
samer@0 | 7 |
samer@0 | 8 ;;; Training |
samer@0 | 9 (define t-scaler (BatchedTrainer. (.getScaleTrainer scaler) 4)) |
samer@0 | 10 (define t-genexp (BatchedTrainer. (.getTrainer genexp) 256)) |
samer@0 | 11 (define t-ica (BatchedTrainer. (.getTrainer ica) (.size x))) |
samer@0 | 12 |
samer@0 | 13 (.setOutputModel ica scaler) |
samer@0 | 14 (.setOutputModel scaler genexp) |
samer@0 | 15 |
samer@0 | 16 ;;; resync and compute basis every 16 ICA updates |
samer@0 | 17 (.setFlushTask t-ica |
samer@0 | 18 (sub 32 (seq |
samer@0 | 19 (ICAScalerSync. ica scaler) |
samer@0 | 20 (task (exec ica "basis"))))) |
samer@0 | 21 |
samer@0 | 22 ;;; Runnable tasks |
samer@0 | 23 (addtasks |
samer@0 | 24 ica |
samer@0 | 25 scaler |
samer@0 | 26 genexp |
samer@0 | 27 (task (.compute scaler)) |
samer@0 | 28 t-genexp t-scaler t-ica |
samer@0 | 29 ) |
samer@0 | 30 |
samer@0 | 31 ;;; return all bits and pieces |
samer@0 | 32 (list ica scaler genexp t-ica t-scaler t-genexp) |
samer@0 | 33 ) |