|
|
|
|
@ -1,11 +1,11 @@
|
|
|
|
|
FluidBaseMLP : FluidDataClient {
|
|
|
|
|
FluidMLPRegressor : FluidRTDataClient {
|
|
|
|
|
|
|
|
|
|
const <identity = 0;
|
|
|
|
|
const <sigmoid = 1;
|
|
|
|
|
const <relu = 2;
|
|
|
|
|
const <tanh = 3;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*new {|server, hidden = #[3,3] , activation = 0, maxIter = 100, learnRate = 0.0001, momentum = 0.9, batchSize = 50, validation = 0.2|
|
|
|
|
|
*new {|server, hidden = #[3,3] , activation = 0, outputLayer = 0, maxIter = 100, learnRate = 0.0001, momentum = 0.9, batchSize = 50, validation = 0.2|
|
|
|
|
|
var hiddenCtrlLabels;
|
|
|
|
|
hidden = [hidden.size]++hidden;
|
|
|
|
|
|
|
|
|
|
@ -15,6 +15,7 @@ FluidBaseMLP : FluidDataClient {
|
|
|
|
|
[hiddenCtrlLabels,hidden].lace ++
|
|
|
|
|
[
|
|
|
|
|
\activation,activation,
|
|
|
|
|
\outputLayer, outputLayer,
|
|
|
|
|
\maxIter, maxIter,
|
|
|
|
|
\learnRate,learnRate,
|
|
|
|
|
\momentum, momentum,
|
|
|
|
|
@ -27,13 +28,6 @@ FluidBaseMLP : FluidDataClient {
|
|
|
|
|
this.prSendMsg(\clear,action:action);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FluidMLPRegressor : FluidBaseMLP {
|
|
|
|
|
*new {|server, hidden = #[3,3] , activation = 0, maxIter = 100, learnRate = 0.0001, momentum = 0.9, batchSize = 50, validation = 0.2|
|
|
|
|
|
^super.new(server,hidden,activation, maxIter,learnRate, momentum, batchSize,validation)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fit{|sourceDataSet, targetDataSet, action|
|
|
|
|
|
this.prSendMsg(\fit,
|
|
|
|
|
[sourceDataSet.asSymbol, targetDataSet.asSymbol],
|
|
|
|
|
@ -41,23 +35,49 @@ FluidMLPRegressor : FluidBaseMLP {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
predict{ |sourceDataSet, targetDataSet, layer, action|
|
|
|
|
|
predict{ |sourceDataSet, targetDataSet, action|
|
|
|
|
|
this.prSendMsg(\predict,
|
|
|
|
|
[sourceDataSet.asSymbol, targetDataSet.asSymbol,layer],
|
|
|
|
|
[sourceDataSet.asSymbol, targetDataSet.asSymbol],
|
|
|
|
|
action);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
predictPoint { |sourceBuffer, targetBuffer, layer action|
|
|
|
|
|
predictPoint { |sourceBuffer, targetBuffer, action|
|
|
|
|
|
this.prSendMsg(\predictPoint,
|
|
|
|
|
[sourceBuffer.asUGenInput, targetBuffer.asUGenInput, layer], action);
|
|
|
|
|
[sourceBuffer.asUGenInput, targetBuffer.asUGenInput], action);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FluidMLPClassifier : FluidBaseMLP {
|
|
|
|
|
|
|
|
|
|
FluidMLPClassifier : FluidRTDataClient {
|
|
|
|
|
|
|
|
|
|
const <identity = 0;
|
|
|
|
|
const <sigmoid = 1;
|
|
|
|
|
const <relu = 2;
|
|
|
|
|
const <tanh = 3;
|
|
|
|
|
|
|
|
|
|
*new {|server, hidden = #[3,3] , activation = 0, maxIter = 100, learnRate = 0.0001, momentum = 0.9, batchSize = 50, validation = 0.2|
|
|
|
|
|
^super.new(server,hidden,activation, maxIter,learnRate, momentum, batchSize,validation)
|
|
|
|
|
var hiddenCtrlLabels;
|
|
|
|
|
hidden = [hidden.size]++hidden;
|
|
|
|
|
|
|
|
|
|
hiddenCtrlLabels = hidden.collect{|x,i| \hidden++i};
|
|
|
|
|
|
|
|
|
|
^super.new1(server,
|
|
|
|
|
[hiddenCtrlLabels,hidden].lace ++
|
|
|
|
|
[
|
|
|
|
|
\activation,activation,
|
|
|
|
|
\maxIter, maxIter,
|
|
|
|
|
\learnRate,learnRate,
|
|
|
|
|
\momentum, momentum,
|
|
|
|
|
\batchsize,batchSize,
|
|
|
|
|
\validation,validation,
|
|
|
|
|
])
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
clear{ |action|
|
|
|
|
|
this.prSendMsg(\clear,action:action);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fit{|sourceDataSet, targetLabelSet, action|
|
|
|
|
|
this.prSendMsg(\fit,
|
|
|
|
|
[sourceDataSet.asSymbol, targetLabelSet.asSymbol],
|
|
|
|
|
@ -65,14 +85,14 @@ FluidMLPClassifier : FluidBaseMLP {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
predict{ |sourceDataSet, targetLabelSet, action|
|
|
|
|
|
predict{ |sourceDataSet, targetDataSet, action|
|
|
|
|
|
this.prSendMsg(\predict,
|
|
|
|
|
[sourceDataSet.asSymbol, targetLabelSet.asSymbol],
|
|
|
|
|
[sourceDataSet.asSymbol, targetDataSet.asSymbol],
|
|
|
|
|
action);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
predictPoint { |sourceBuffer, action|
|
|
|
|
|
this.prSendMsg(\predictPoint,
|
|
|
|
|
[sourceBuffer.asUGenInput], action,string(FluidMessageResponse,_,_));
|
|
|
|
|
[sourceBuffer.asUGenInput], action, string(FluidMessageResponse,_,_));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|