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

Initial Mercurial check in.
author samer
date Tue, 17 Jan 2012 17:50:20 +0000
parents
children
line wrap: on
line source
(import "samer.models.*")

(define (newica x)
	(define ica (ICA. x))
	(define scaler (DiffScaler. (.output ica)))
	(define genexp (GeneralisedExponential. (.output scaler)))

	;;; Training
	(define t-scaler (BatchedTrainer. (.getScaleTrainer scaler) 4))
	(define t-genexp (BatchedTrainer. (.getTrainer genexp) 256))
	(define t-ica    (BatchedTrainer. (.getTrainer ica) (.size x)))

	(.setOutputModel ica scaler)
	(.setOutputModel scaler genexp)

	;;; resync and compute basis every 16 ICA updates
	(.setFlushTask t-ica
		(sub 32 (seq
			(ICAScalerSync. ica scaler)
			(task (exec ica "basis")))))

	;;; Runnable tasks
	(addtasks
		ica
		scaler
		genexp
		(task (.compute scaler))
		t-genexp t-scaler t-ica
	)

	;;; return all bits and pieces
	(list ica scaler genexp t-ica t-scaler t-genexp)
)