Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing fluid.normalize json reloading issue #262

Merged
merged 3 commits into from
Feb 23, 2024
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: 3 additions & 0 deletions include/algorithms/public/Normalization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class Normalization
using namespace _impl;
mMin = min;
mMax = max;
mRange = mMax - mMin;
handleZerosInScale(mRange);
mDataMin = asEigen<Array>(dataMin);
mDataMax = asEigen<Array>(dataMax);
mDataRange = mDataMax - mDataMin;
Expand Down Expand Up @@ -132,6 +134,7 @@ class Normalization
{
mMin = 0;
mMax = 1.0;
mRange = 1.0;
mDataMin.setZero();
mDataMax.setZero();
mDataRange.setZero();
Expand Down
6 changes: 0 additions & 6 deletions include/clients/nrt/NormalizeClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ class NormalizeClient : public FluidBaseClient,
StringVector ids{srcDataSet.getIds()};
RealMatrix data(srcDataSet.size(), srcDataSet.pointSize());
if (!mAlgorithm.initialized()) return Error(NoDataFitted);
mAlgorithm.setMin(get<kMin>());
mAlgorithm.setMax(get<kMax>());
mAlgorithm.process(srcDataSet.getData(), data, invert);
FluidDataSet<string, double, 1> result(ids, data);
destPtr->setDataSet(result);
Expand All @@ -166,8 +164,6 @@ class NormalizeClient : public FluidBaseClient,
RealVector src(mAlgorithm.dims());
RealVector dest(mAlgorithm.dims());
src <<= BufferAdaptor::ReadAccess(in.get()).samps(0, mAlgorithm.dims(), 0);
mAlgorithm.setMin(get<kMin>());
mAlgorithm.setMax(get<kMax>());
mAlgorithm.processFrame(src, dest, invert);
outBuf.samps(0, mAlgorithm.dims(), 0) <<= dest;
return OK();
Expand Down Expand Up @@ -239,8 +235,6 @@ class NormalizeQuery : public FluidBaseClient, ControlIn, ControlOut
RealVector dest(algorithm.dims());
src <<= BufferAdaptor::ReadAccess(get<kInputBuffer>().get())
.samps(0, algorithm.dims(), 0);
// algorithm.setMin(get<kMin>());
// algorithm.setMax(get<kMax>());
algorithm.processFrame(src, dest, get<kInvert>() == 1);
outBuf.samps(0, algorithm.dims(), 0) <<= dest;
}
Expand Down
Loading