Code Monkey home page Code Monkey logo

Comments (9)

jonandergomez avatar jonandergomez commented on June 15, 2024

Hello Florian,

Could you provide a couple of examples for the resulting object you are asking for using different shapes of the tensors contained in vector<Tensor *>?

Best Regards,

Jon

from eddl.

FlorianThaler avatar FlorianThaler commented on June 15, 2024

Hello Jon.

Actually what I would like to do something like that
[...]
model_ = import_net_from_onnx_file(params.modelPath);
eddl::build(model_);
[...]
Tensor* x = new Tensor({x1, x2, x3, x4, x5}, {1, 5});
vector<Tensor*> y = model_->predict({x});

vector<double> weights;
weights = y.to_vector();                                  <<< **this is where I am stuck right now**
std::discrete_distribution<> d(weights.begin(), weights.end());
std::random_device rd;
auto ctrl_idx = d(rd);
[...]

BR, Florian

from eddl.

RParedesPalacios avatar RParedesPalacios commented on June 15, 2024

Hi, i have just implemented a new function: to_std(), an example:

t1 = Tensor::ones({5, 1});
std::vector vf=t1->to_std();

The result is a std_vector that maps the same memory of the tensor. Obviously the tensor could have several dimensions but std_vector is just a vector but all the values are there in a row-wise order.

Rigth now is a std_vector of floats. If you need doubles then it would be different since internal tensor pointer (and values) is a float pointer. But just try with this solution and let us know.

from eddl.

FlorianThaler avatar FlorianThaler commented on June 15, 2024

Thanks a lot. I'll try.

BR, Florian

from eddl.

jonandergomez avatar jonandergomez commented on June 15, 2024

Hi Florian,

Just one additional question, do you download the master branch and compile the EDDL from the source code? Or do you need us to release a new version with this newly added feature?

Regards,

Jon

from eddl.

FlorianThaler avatar FlorianThaler commented on June 15, 2024

Hi Jon,

so far we used build our docker container using one of your releases (by calling wget https://github.com/deephealthproject/eddl/archive/refs/tags/v1.1b.tar.gz). The best for us would be if you could provide another release - then rebuilding our container should be easy.

BR, Florian

from eddl.

jonandergomez avatar jonandergomez commented on June 15, 2024

I will do it asap and notify you, but you have to use a new tag.

from eddl.

jonandergomez avatar jonandergomez commented on June 15, 2024

Hi again,

@FlorianThaler you can now check the new tag with the new feature: https://github.com/deephealthproject/eddl/archive/refs/tags/v1.2b.tar.gz

Regards,

Jon

from eddl.

FlorianThaler avatar FlorianThaler commented on June 15, 2024

Great, thanks.

from eddl.

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.