Knnregressor multiout (#153)

Amend `KNNRegressor` to multi-dimensional mapping
nix
tremblap 3 years ago committed by GitHub
parent c59b359023
commit 21c4311471
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -28,18 +28,22 @@ FluidKNNRegressor : FluidModelObject {
this.prSendMsg(this.predictMsg(sourceDataSet, targetDataSet)); this.prSendMsg(this.predictMsg(sourceDataSet, targetDataSet));
} }
predictPointMsg { |buffer| predictPointMsg { |sourceBuffer, targetBuffer|
^this.prMakeMsg(\predictPoint,id, this.prEncodeBuffer(buffer)); ^this.prMakeMsg(\predictPoint,id,
this.prEncodeBuffer(sourceBuffer),
this.prEncodeBuffer(targetBuffer),
["/b_query", targetBuffer.asUGenInput]);
} }
predictPoint { |buffer, action| predictPoint { |sourceBuffer, targetBuffer, action|
actions[\predictPoint] = [number(FluidMessageResponse,_,_),action]; actions[\predictPoint] = [nil,{action.value(targetBuffer)}];
this.prSendMsg(this.predictPointMsg(buffer)); this.predictPointMsg(sourceBuffer, targetBuffer);
this.prSendMsg(this.predictPointMsg(sourceBuffer, targetBuffer));
} }
kr{|trig, inputBuffer,outputBuffer| kr{|trig, inputBuffer, outputBuffer, numNeighbours, weight|
^FluidKNNRegressorQuery.kr(K2A.ar(trig), ^FluidKNNRegressorQuery.kr(K2A.ar(trig),
this, this.numNeighbours, this.weight, this, numNeighbours??{this.numNeighbours}, weight??{this.weight},
this.prEncodeBuffer(inputBuffer), this.prEncodeBuffer(inputBuffer),
this.prEncodeBuffer(outputBuffer)); this.prEncodeBuffer(outputBuffer));
} }

Loading…
Cancel
Save