Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/flucoma/clients/nrt/KMeansClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ class KMeansQuery : public FluidBaseClient, ControlIn, ControlOut
void process(std::vector<FluidTensorView<T, 1>>& input,
std::vector<FluidTensorView<T, 1>>& output, FluidContext&)
{
output[0] <<= input[0];
output[0](0) = 0;
if (input[0](0) > 0)
{
auto kmeansPtr = get<kModel>().get().lock();
Expand Down Expand Up @@ -344,6 +344,7 @@ class KMeansQuery : public FluidBaseClient, ControlIn, ControlOut
point <<= BufferAdaptor::ReadAccess(get<kInputBuffer>().get())
.samps(0, dims, 0);
outSamps[0] = kmeansPtr->algorithm().vq(point);
output[0](0) = 1;
}
}

Expand Down
3 changes: 2 additions & 1 deletion include/flucoma/clients/nrt/KNNClassifierClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class KNNClassifierQuery : public FluidBaseClient, ControlIn, ControlOut
void process(std::vector<FluidTensorView<T, 1>>& input,
std::vector<FluidTensorView<T, 1>>& output, FluidContext& c)
{
output[0] <<= input[0];
output[0](0) = 0;
if (input[0](0) > 0)
{
auto knnPtr = get<kModel>().get().lock();
Expand All @@ -267,6 +267,7 @@ class KNNClassifierQuery : public FluidBaseClient, ControlIn, ControlOut
std::string const& result = classifier.predict(
algorithm.tree, point, algorithm.labels, k, weight, c.allocator());
outBuf.samps(0)[0] = static_cast<double>(knnPtr->encodeIndex(result));
output[0](0) = 1;
}
}

Expand Down
3 changes: 2 additions & 1 deletion include/flucoma/clients/nrt/KNNRegressorClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class KNNRegressorQuery : public FluidBaseClient, ControlIn, ControlOut
void process(std::vector<FluidTensorView<T, 1>>& input,
std::vector<FluidTensorView<T, 1>>& output, FluidContext& c)
{
output[0] <<= input[0];
output[0](0) = 0;
if (input[0](0) > 0)
{
auto knnPtr = get<kModel>().get().lock();
Expand Down Expand Up @@ -272,6 +272,7 @@ class KNNRegressorQuery : public FluidBaseClient, ControlIn, ControlOut
regressor.predict(algorithm.tree, algorithm.target, in, out, k,
weight, c.allocator());
outBuf.samps(0) <<= out;
output[0](0) = 1;
}
}

Expand Down
3 changes: 2 additions & 1 deletion include/flucoma/clients/nrt/MLPClassifierClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ class MLPClassifierQuery : public FluidBaseClient, ControlIn, ControlOut
void process(std::vector<FluidTensorView<T, 1>>& input,
std::vector<FluidTensorView<T, 1>>& output, FluidContext&)
{
output[0] <<= input[0];
output[0](0) = 0;
if (input[0](0) > 0)
{
auto mlpPtr = get<kModel>().get().lock();
Expand Down Expand Up @@ -350,6 +350,7 @@ class MLPClassifierQuery : public FluidBaseClient, ControlIn, ControlOut
auto& label = algorithm.encoder.decodeOneHot(dest);
outBuf.samps(0)[0] =
static_cast<double>(algorithm.encoder.encodeIndex(label));
output[0](0) = 1;
}
}

Expand Down
3 changes: 2 additions & 1 deletion include/flucoma/clients/nrt/MLPRegressorClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ class MLPRegressorQuery : public FluidBaseClient, ControlIn, ControlOut
void process(std::vector<FluidTensorView<T, 1>>& input,
std::vector<FluidTensorView<T, 1>>& output, FluidContext&)
{
output[0] <<= input[0];
output[0](0) = 0;
if (input[0](0) > 0)
{
auto MLPRef = get<kModel>().get().lock();
Expand Down Expand Up @@ -341,6 +341,7 @@ class MLPRegressorQuery : public FluidBaseClient, ControlIn, ControlOut
.samps(0, inputSize, 0);
algorithm.processFrame(src, dest, inputTap, outputTap);
outBuf.samps(0, outputSize, 0) <<= dest;
output[0](0) = 1;
}
}

Expand Down
3 changes: 2 additions & 1 deletion include/flucoma/clients/nrt/NormalizeClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class NormalizeQuery : public FluidBaseClient, ControlIn, ControlOut
void process(std::vector<FluidTensorView<T, 1>>& input,
std::vector<FluidTensorView<T, 1>>& output, FluidContext&)
{
output[0] <<= input[0];
output[0](0) = 0;
if (input[0](0) > 0)
{
auto normPtr = get<kModel>().get().lock();
Expand All @@ -237,6 +237,7 @@ class NormalizeQuery : public FluidBaseClient, ControlIn, ControlOut
.samps(0, algorithm.dims(), 0);
algorithm.processFrame(src, dest, get<kInvert>() == 1);
outBuf.samps(0, algorithm.dims(), 0) <<= dest;
output[0](0) = 1;
}
}

Expand Down
3 changes: 2 additions & 1 deletion include/flucoma/clients/nrt/PCAClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class PCAQuery : public FluidBaseClient, ControlIn, ControlOut
void process(std::vector<FluidTensorView<T, 1>>& input,
std::vector<FluidTensorView<T, 1>>& output, FluidContext& c)
{
output[0] <<= input[0];
output[0](0) = 0;
if (input[0](0) > 0)
{
auto PCAPtr = get<kModel>().get().lock();
Expand All @@ -266,6 +266,7 @@ class PCAQuery : public FluidBaseClient, ControlIn, ControlOut
.samps(0, algorithm.dims(), 0);
algorithm.processFrame(src, dest, k, get<kWhiten>() == 1);
outBuf.samps(0, k, 0) <<= dest;
output[0](0) = 1;
}
}

Expand Down
3 changes: 2 additions & 1 deletion include/flucoma/clients/nrt/RobustScaleClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class RobustScaleQuery : public FluidBaseClient, ControlIn, ControlOut
void process(std::vector<FluidTensorView<T, 1>>& input,
std::vector<FluidTensorView<T, 1>>& output, FluidContext&)
{
output[0] <<= input[0];
output[0](0) = 0;
if (input[0](0) > 0)
{
auto robustPtr = get<kModel>().get().lock();
Expand All @@ -239,6 +239,7 @@ class RobustScaleQuery : public FluidBaseClient, ControlIn, ControlOut
.samps(0, algorithm.dims(), 0);
algorithm.processFrame(src, dest, get<kInvert>() == 1);
outBuf.samps(0, algorithm.dims(), 0) <<= dest;
output[0](0) = 1;
}
}

Expand Down
3 changes: 2 additions & 1 deletion include/flucoma/clients/nrt/SKMeansClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ class SKMeansQuery : public FluidBaseClient, ControlIn, ControlOut
void process(std::vector<FluidTensorView<T, 1>>& input,
std::vector<FluidTensorView<T, 1>>& output, FluidContext&)
{
output[0] = input[0];
output[0](0) = 0;
if (input[0](0) > 0)
{
auto kmeansPtr = get<kModel>().get().lock();
Expand All @@ -342,6 +342,7 @@ class SKMeansQuery : public FluidBaseClient, ControlIn, ControlOut
point <<= BufferAdaptor::ReadAccess(get<kInputBuffer>().get())
.samps(0, dims, 0);
outSamps[0] = kmeansPtr->algorithm().vq(point);
output[0](0) = 1;
}
}

Expand Down
3 changes: 2 additions & 1 deletion include/flucoma/clients/nrt/StandardizeClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class StandardizeQuery : public FluidBaseClient, ControlIn, ControlOut
void process(std::vector<FluidTensorView<T, 1>>& input,
std::vector<FluidTensorView<T, 1>>& output, FluidContext&)
{
output[0] <<= input[0];
output[0](0) = 0;
if (input[0](0) > 0)
{
auto stdPtr = get<kModel>().get().lock();
Expand All @@ -235,6 +235,7 @@ class StandardizeQuery : public FluidBaseClient, ControlIn, ControlOut
.samps(0, algorithm.dims(), 0);
algorithm.processFrame(src, dest, get<kInvert>() == 1);
outBuf.samps(0, algorithm.dims(), 0) <<= dest;
output[0](0) = 1;
}
}

Expand Down
3 changes: 2 additions & 1 deletion include/flucoma/clients/nrt/UMAPClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class UMAPQuery : public FluidBaseClient, ControlIn, ControlOut
void process(std::vector<FluidTensorView<T, 1>>& input,
std::vector<FluidTensorView<T, 1>>& output, FluidContext&)
{
output[0] <<= input[0];
output[0](0) = 0;
if (input[0](0) > 0)
{
auto UMAPPtr = get<kModel>().get().lock();
Expand All @@ -233,6 +233,7 @@ class UMAPQuery : public FluidBaseClient, ControlIn, ControlOut
.samps(0, inSize, 0);
algorithm.transformPoint(src, dest);
outBuf.samps(0, outSize, 0) <<= dest;
output[0](0) = 1;
}
}

Expand Down