octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Working on nnet package


From: Marius Schamschula
Subject: Re: Working on nnet package
Date: Thu, 11 Apr 2019 20:30:08 -0500

> 
> On Apr 11, 2019, at 6:25 PM, Mike Miller <address@hidden> wrote:
> 
> On Thu, Apr 11, 2019 at 19:05:09 -0400, Mae wrote:
>> 
>>> On  11, 2019, at 18:42, Alois Schlögl <address@hidden> wrote:
>>> 
>>> A much more promising approach seems incorporating some open sourced
>>> Deep Learning framework into Octave. E.g. setting up an interface to
>>> Tensorflow or ONNX through mex/oct C/C++ interface would be an
>>> interesting task. Looking at the c_api of TF 1.13, it seems that one
>>> need to get familiar with dataflow graphs, and protobuf, etc. Matlab
>>> uses ONNX, so for compatibility one might use ONNX; otoh, Google's
>>> Tensorflow seems to be technologically more advanced, therefore, I'd go
>>> with a mex interface to tensorflow. It's certainly not a trivial
>>> project, but it should be possible. There are already TF interfaces for
>>> a number of other languages, so way not Octave as well.
>> 
>> As a person who uses pytorch for experimental deep learning experiments
>> it also is an attractive target which seems to be the most popular (at
>> least in research) in recent months.
> 
> It should be possible to use either TensorFlow or PyTorch directly today
> with Octave and the Python interface. I have not worked with either, but
> just glancing at a tutorial, the following works in Octave for me
> 
>>> x1 = py.tensorflow.constant(py.list([1, 2, 3, 4]));
>>> x2 = py.tensorflow.constant(py.list([5, 6, 7, 8]));
>>> result = py.tensorflow.multiply(x1, x2);
>>> session = py.tensorflow.Session();
>>> session.run(result)
>    ans = [Python object of type numpy.ndarray]
> 
>      [ 5. 12. 21. 32.]

For an example of how to use python with an octave package, have a look at the 
symbolic package, it uses python and sympy.

>>> session.close()
> 
> I would be happy to work with anyone interested to develop better
> motivating examples that can demonstrate how to leverage these popular
> Python libraries in Octave.
> 
> -- 
> mike
> 

Marius
--
Marius Schamschula




reply via email to

[Prev in Thread] Current Thread [Next in Thread]