saveMeans
method.
% #--- Do that on n machines --- % lda saveMeans means.$x % close [open ok.mean.$x w]Note that $x is for example the number of the part running from 1 to n. We also "touch" a file
ok.mean.$x
to indicate that this part
is done.
The loadMeans
method on the other hand accumulates means
when reading them from file. Before reading you should make sure to clear
the means first. The while loop checks every 100 seconds if the 'ok' files
exists.
% #--- collect means on one machine --- % lda clearMeans % for {set x 1} {$x <= $n} {incr x} { > while {![file exists ok.mean.$x]} {after 100000} > lda loadMeans means.$x > } % lda saveMeans means.allNow the file
means.all
contains the mean vectors just as
you would have done the whole database. (That is not exactly true because
the values are stored in float format in the file and not in doubles as they
were represented during runtime. But as long as the counts in the files
are not very different from each other that's no problem.)
loadScatters
method to
mix them all together.
% #--- Do that on n machines --- % # creating scatter.$x.T % # and scatter.$x.W % #----------------------------- % lda saveScatters scatter.$x % close [open ok.scatter.$x w]
% #--- collect scatters on one machine --- % lda clearScatters % for {set x 1} {$x <= $n} {incr x} { > while {![file exists ok.scatter.$x]} {after 100000} > lda loadScatters scatter.$x > }