Giter VIP home page Giter VIP logo

Comments (6)

dancazarin avatar dancazarin commented on May 23, 2024 1

@netlcod
Thank you for reporting this issue. The adapt function is required here for multidimensional arrays (tensors), so it isn't an option to remove it. But the adapt function assumes a valid index passed to it which isn't a case for the stop index (past-the-end index). This also affected all expressions that relied on start and stop arguments in their begin_pass and end_pass functions.
I've pushed a fix, could you try to pull dev branch and rerun your tests?

from kfr.

netlcod avatar netlcod commented on May 23, 2024

In the line bqfilter->apply(batch); filtering gives wrong result.
But if you replace it with bqfilter->apply(batch.data(), samples+1), the result becomes adequate.
Result with samples+1:
image

What i do wring? Or it is library bug?

from kfr.

netlcod avatar netlcod commented on May 23, 2024

It seems to me that the library is the problem. When get_element gets a invalid index, it returns 0. So for the last sample it returns 0 instead of a valid value.

from kfr.

netlcod avatar netlcod commented on May 23, 2024

In the file kfr/base/expression.cpp at line 726
begin_pass(in, inshape.adapt(start), inshape.adapt(stop));
the array size is reduced. If you replace it to the line
begin_pass(in, start, stop);
the filters work normally.

So I have a question, I need to replace
begin_pass(in, inshape.adapt(start), inshape.adapt(stop));
to the line
begin_pass(in, start, stop);
or i need replace in file shape.hpp in line 283
return other.template trim<dims>()->min(**this - 1);
to the
return other.template trim<dims>()->min(**this);

from kfr.

netlcod avatar netlcod commented on May 23, 2024

@dancazarin ?

from kfr.

netlcod avatar netlcod commented on May 23, 2024

@dancazarin yes, it works, thanks!

from kfr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.