comparison src/scheme/newica.scm @ 0:bf79fb79ee13

Initial Mercurial check in.
author samer
date Tue, 17 Jan 2012 17:50:20 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:bf79fb79ee13
1 (import "samer.models.*")
2
3 (define (newica x)
4 (define ica (ICA. x))
5 (define scaler (DiffScaler. (.output ica)))
6 (define genexp (GeneralisedExponential. (.output scaler)))
7
8 ;;; Training
9 (define t-scaler (BatchedTrainer. (.getScaleTrainer scaler) 4))
10 (define t-genexp (BatchedTrainer. (.getTrainer genexp) 256))
11 (define t-ica (BatchedTrainer. (.getTrainer ica) (.size x)))
12
13 (.setOutputModel ica scaler)
14 (.setOutputModel scaler genexp)
15
16 ;;; resync and compute basis every 16 ICA updates
17 (.setFlushTask t-ica
18 (sub 32 (seq
19 (ICAScalerSync. ica scaler)
20 (task (exec ica "basis")))))
21
22 ;;; Runnable tasks
23 (addtasks
24 ica
25 scaler
26 genexp
27 (task (.compute scaler))
28 t-genexp t-scaler t-ica
29 )
30
31 ;;; return all bits and pieces
32 (list ica scaler genexp t-ica t-scaler t-genexp)
33 )