Discussion:
Now Squeak linux bindings working OK for FANN 2.2
Casimiro de Almeida Barreto
2009-05-29 13:21:58 UTC
Permalink
I guess that for linux squeakers interested in using FANN these are
great news.

It is necessary to load the latest versions of CommandShell, OSProcess
and OSProcessPlugin. It is necessary to use VMMaker and rebuild VM to
include OSProcessPlugin. So, a big thank you to David Lewis who helped a
lot enhancing OSProcess, OSProcessPlugin and CommandShell.

Sample code:

ffiProcess := [
(Delay forSeconds: 5) wait.

fInterface apiFannPrintParameters: theFANN.

fInterface apiFannTrain: theFANN
onFile: trainingDataFileName
times: theMaxEpochs
reporting: numberOfEpochs
toPrecision: theDesiredError.

fInterface apiFannSave: theFANN toFile: networkFileName].

child := PipeableOSProcess forkHeadlessSqueakAndDoThenQuit: ffiProcess.

rProcess := [
[ OSProcess command: 'sync'.
charsFromChild := child upToEnd.
1 to: charsFromChild size do: [ :i |
(charsFromChild at: i) = Character lf
ifTrue: [ charsFromChild at: i put: Character cr ]].
Transcript show: charsFromChild.
(Delay forSeconds: 5) wait ] repeat ] fork.

[ child isRunning] whileTrue: [ (Delay forSeconds: 5) wait ].

rProcess terminate.

fInterface apiFannDestroyTrain: tData.
fInterface apiFannDestroy: theFANN.

Loading...