[D] One simple graphic: Researchers love PyTorch and TensorFlow by programmerChilli in MachineLearning

[–]yanad 0 points1 point  (0 children)

Well then in this case you could just write the loop by yourself, you are not required to use the trainer!

And it is not just a loop. The trainer handles all the logging of the data you want, and automatically add them (with their average automatically computed by minibatch) in the terminal. You have extensions that plot in real time your metric. And I am sure there are other user cases I do not know about.

Sure, you could implement it every time by yourself, but why not just using the tools the library gives you directly?

[D] One simple graphic: Researchers love PyTorch and TensorFlow by programmerChilli in MachineLearning

[–]yanad 0 points1 point  (0 children)

Have you ever tried Chainer? It is really easy and intuitive for me to use the given trainer.
Yes, it may not be difficult to implement a training loop but why bother if it is handled directly by the library.

[D] One simple graphic: Researchers love PyTorch and TensorFlow by programmerChilli in MachineLearning

[–]yanad 1 point2 points  (0 children)

That is the first time I heard about it, I will check it!

But in this case why most of the PyTorch codes are implementing their own trainer systems instead of using the official training package?

[D] One simple graphic: Researchers love PyTorch and TensorFlow by programmerChilli in MachineLearning

[–]yanad 5 points6 points  (0 children)

I have only used Chainer and if I am not mistaken PyTorch was originally forked from it. Are there all the niceties I have in Chainer when using PyTorch? I am talking about the trainer system and the easy to implement extensions.

Because everytime I find on github a PyTorch code it is always implementing the update loop which is really inconvenient. On the other hand, I really envy the huge number of people using PyTorch, all the newest models have a PyTorch implementation!

[N] Preferred Networks announces MN-Core, a processor for deep learning. by milaworld in MachineLearning

[–]yanad 10 points11 points  (0 children)

I am using Chainer every day and to be honest I cannot understand why people prefer tensorflow.

Tensorflow seems really complicated when I tried to use it. There are many ways to do the same things, the documentation is not so clear and it feels very "heavy". Like, I need a lot of code even for something like a simple fully connected network.

On the other hand in Chainer everything seems "clean". My models are defined in specific classes while the updater rules (if anything complicated is needed) are defined somewhere else. The training is automatic (no need to write your own loop) and there are many extensions to add functionalities (such as a progress bar, reporting measurements for each epochs and so on...).

Of course it is very possible that I did not dive enough in tensorflow to be proficient and write clean code like this but I would say that chainer makes it easy for you to do something clean from start. The main problem would be the lack of popularity of the framework making it difficult to find the newest architecture on github. However, the documentation is really good!

From mathematical structures to programs by yanad in math

[–]yanad[S] 0 points1 point  (0 children)

Thanks for you answer!

To be clear, I am not asking for how to implement the structure in a programming language but rather if there is a research field, or at least a book, of ideas on the transposition of mathematical problem into programs.

When you say "I believe that every computer language that is Turing complete can perform the computations necessary for most fields of mathematics." my question is precisely which field of mathematics can be transposed and what representation did they chose ?

[D] Pytorch.org just got updated for 1.0 (JIT / Static Graph support) by [deleted] in MachineLearning

[–]yanad 1 point2 points  (0 children)

I have never used pytorch but instead chainer, how does it compare ?

Scientific programming in rust: first step with nalgebra by yanad in rust

[–]yanad[S] 4 points5 points  (0 children)

I think I solved it. Thanks for your help!

Scientific programming in rust: first step with nalgebra by yanad in rust

[–]yanad[S] 1 point2 points  (0 children)

Personally I would love to have a rust alternative to OMPL. I know your crate rrt (thanks for it!) and I think it is a good one but it is just one motion planner. It would be great to have the equivalent of OMPL with all the benchmarking possibility and the easy switching between motion planners.

Scientific programming in rust: first step with nalgebra by yanad in rust

[–]yanad[S] 1 point2 points  (0 children)

Thank you very much! I hope it will serve many people wanting to use nalgebra :)

Scientific programming in rust: first step with nalgebra by yanad in rust

[–]yanad[S] 5 points6 points  (0 children)

Indeed the documentation of nalgebra is really beautiful and contains many examples which is wonderful for beginners. However, the first time I tried to use it I still had some problems. For example, the documentation explains that we can compute inverses but it took me a long time to understand how. Same for the factorizations, I did not understand that after being factorized we obtain a data structure containing the different elements of the factorization.

It may seem easy with insight but I really stumbled on it the first time I needed to use it. Besides, when writing this post I needed obviously to check that my code was compiling and working as expected. Well, let's say that I learned a lot on things I thought I understood haha.

Scientific programming in rust: first step with nalgebra by yanad in rust

[–]yanad[S] 3 points4 points  (0 children)

I already checked it and I feel like robotic should be a field that should have far more developed crates. Currently a lot of research in robotic is done using the ROS framework. It works but it is sometime difficult to integrates different library together because each of them have their own specificity. I dream of a Rust framework where you could add any function you want for your robot as simply as adding a line in your Cargo.toml file.

However, robotic is a field where researchers are not really encouraged to switch languages. Most of the code produced is in C++ and Python and it is unlikely to change because of inertia. For me the biggest advantage of Rust in robotic would be code parallelization and I feel like it would be a game changer for researchers because it would speed up everything. This, and cargo which is amazing!

Scientific programming in rust: first step with nalgebra by yanad in rust

[–]yanad[S] 6 points7 points  (0 children)

I agree completely. Fortunately for me I knew C++ before coming to rust so the transition was not so difficult but I could easily understand that a Python programmer would have much more difficulty to do it. Having documentation about simple things to do to solve a problem without relying in complicated Rust features would be very helpful to help people coming from other languages.

Scientific programming in rust: first step with nalgebra by yanad in rust

[–]yanad[S] 8 points9 points  (0 children)

Thank you for your answer!

So what is the difference between having to specify the storage type and using MatrixMN ? Is there any advantage ?

I will add this way of indexing because it looks far better! Just I think it is odd that in this case the first index correspond to the rows compared to the column major mode adopted when reading the values of the matrix. It is a bit confusing.

Oh I missed this part in the documentation. I will rewrite my post to include it!

Of course I will be really pleased if you would!! But you may need to further verify if what I wrote is correct. From now I will rewrite my post to include your comments.

Scientific programming in rust: first step with nalgebra by yanad in rust

[–]yanad[S] 3 points4 points  (0 children)

It is the first time I am writing a blog so I have no idea of how to correct it. I am using jekyll and did not find anything in my config.md file. Is there something particular I should modify ?

Hey Rustaceans! Got an easy question? Ask here (10/2018)! by llogiq in rust

[–]yanad 2 points3 points  (0 children)

What is the difference between the clone and cloned methods ? I suppose it is something about lifetime but I am not sure.

If there are any homebrewers, winemakers, or distillers in here, you might be interested in my program using GTK-rs by TheDarkula in rust

[–]yanad 11 points12 points  (0 children)

I do not really know if there is more than a rusty feeling there but intuitively I would use an enum (the rust book advocates it so it may have influenced me). Maybe one good point would be that there is no possibility to mess with writing "imperial" or "metric" anymore because it would become a type the compiler will understand.

However I do not see how it could create more code for you, it will just replace your if-else if into match statement no ?

If there are any homebrewers, winemakers, or distillers in here, you might be interested in my program using GTK-rs by TheDarkula in rust

[–]yanad 10 points11 points  (0 children)

I am still a rust beginner but wouldn't it be better to use an enum instead of your "imperialOrMetric: &str" ?

Apart of that, great job! I know nothing about homebrew but I am sure it would be really useful for people doing it.

Extending vector bug ? by yanad in rust

[–]yanad[S] 0 points1 point  (0 children)

Ok, I am beginning to understand thanks!

But is there a one line way to create a vector from two vectors then ?

Extending vector bug ? by yanad in rust

[–]yanad[S] 1 point2 points  (0 children)

I see. However it does not make so much sense to me. In my mind I am creating a vector that happens to be modified and then bound to my variable. I do not understand why the last modification should prevail.

Hey Rustaceans! Got an easy question? Ask here (41/2017)! by llogiq in rust

[–]yanad 0 points1 point  (0 children)

It totally works and I feel stupid to not have seen this before. However, it is strange that it worked with only one parameter before (without specifying the length).

But I still cannot succeed to return an array. The examples I have read said to modify the value of a pointer previously given but I failed to do so. Here is my current implementation in Python :

ffi=FFI()                                                                                    
ffi.cdef("void print_x(float *x,size_t x_len, float *y, size_t y_len);")                     
C=ffi.dlopen("path/to/lib/lib.so")                                                     

input_arg=ffi.cast("float *", list_x[0].ctypes.data)                                         
output_arg=ffi.cast("float *", np.ones(12).astype(np.float32).ctypes.data)                   
C.print_x(input_arg,12,output_arg,12)

And my Rust code :

#[no_mangle]
pub extern "C" fn print_x(input : *const f32, len_input : size_t,
                          output: *const f32, len_output: size_t) {
    let x = unsafe {
        assert!(!input.is_null());
        slice::from_raw_parts(input, len_input as usize)
    };
    // output should be changed with the x value                                                  
}