Re: Rust Client Lib

2019-02-08 Thread Zach Boldyga
I did some homework and stumbled across something that changed my view of
where machine learning libraries are headed:

https://github.com/tensorflow/swift/blob/master/docs/WhySwiftForTensorFlow.md

Google & Apple are building first-class support for Tensorflow right into
the Swift language. They chose Swift very carefully, and while they noted
Rust is a great choice for lots of reasons, the learning curve of the
language is too steep... It seems like Rust isn't going to get much love
from the ML community in the places that matter.

I also see that as of writing this, the Rust crate for Tensorflow has only
~10,000 lifetime downloads, which is pretty low considering how much effort
the client library required. So the existing set of practitioners in the
language is very small, and it's unlikely to grow.

Also, the benefits of Rust memory safety and ownership won't really be
realized via a client library that uses FFI on a C API.

I'm not going to move forward with this client lib. I'll check back here in
the future and see if there's any activity... In the meantime, if someone
stumbles across this in the future and wants to pick it up, don't let me
stand in the way!

- Zach


On Wed, Jan 30, 2019 at 11:16 PM Zach Boldyga  wrote:

> Rad, thanks for the input everyone!
>
> I'm anticipating some friction with using FFI with the C API since it's
> considered unsafe in Rust; difficulty of integrating will depend on the
> nuances of the C API as HY mentioned...
>
> Going to go ahead and dive in. Will be back eventually for feedback /
> input!
>
> Zach Boldyga
> Scalabull  |  Founder
> 1 (866) 846-8771 x 101
>
>
> On Wed, Jan 30, 2019 at 12:02 AM HY Chen  wrote:
>
>> I have tried to create a a module via existing rust FFI generators but
>> failed. It seems like you have to think a lot more than just translate the
>> C api to make it work. It's better understand the C API first and make
>> sure
>> it won't introduce new problems in rust.
>>
>> HY
>>
>> Pedro Larroy  于2019年1月30日周三 上午4:35写道:
>>
>> > I have been thinking about this and I find really exciting to have
>> > Rust bindings and bring a powerful framework like MXNet to the Rust
>> > community and to native applications in a convenient Rust crate. I
>> > would love to see this happen. I think basically MXNet needs to be
>> > wrapped in a Rust crate via FFI / C Bindings.
>> >
>> > Pedro.
>> >
>> > On Tue, Jan 29, 2019 at 11:05 AM Zach Boldyga 
>> wrote:
>> > >
>> > > Hey y'all!
>> > >
>> > > I'm thinking about spending this week working on a rust client lib for
>> > > MXNet. saw a little bit of chatter about this in the github issues
>> and no
>> > > strong existing crates at the moment. Any pointers on approaching this
>> > in a
>> > > way that will lead to it being adopted as an officially supported
>> client
>> > > library? And overall yay/nay on whether adding a Rust lib makes sense
>> &
>> > why
>> > > / why not?
>> > >
>> > > Zach Boldyga
>> > > Scalabull  |  Founder
>> > > 1 (866) 846-8771 x 101
>> >
>>
>


Re: Gluon fit API- Design proposal

2019-02-08 Thread Naveen Swamy
Hi Alfredo,
Thanks for your comments, I really like all your suggestions. Here are my
answers let me know if it makes sense or have comments.

1) The fit API is targeting novice users covering about 80% of the use
cases listed in the document. For advanced users,
and complex models, we (Naveen, Ankit and Lai) felt its best use the
existing mechanisms due to the imperative nature and the more control it
can give, So we did not duplicate the save/load functionality in the Hybrid
block.
We’ll consider and extend the functionality to Estimator.
I have had trouble using pickle package which is commonly used for
serialization and deserialization, if you have any other suggestions from
your experience please let us know.

2) +1, we’ll add this to our backlog and add it in our next iteration.

3) Can you expand a little more on this, how it helps in a production
environment (which this API was not target for) ?.
I’ll check the TF Estimator to understand further.

Thanks, Naveen


On Thu, Feb 7, 2019 at 2:32 PM Alfredo Luque
 wrote:

> This is great and something we should all be able to benefit from.
>
> There are just three pieces I’d like to advocate for that I feel are
> shortcomings of some competing APIs on other frameworks (eg; TF Estimators)
> and I would love to see in this proposal:
>
> 1) Make serialization/deserialization of these classifiers/regressors easy
> or at least ensure the internal members of the wrapper are easy to
> save/load. We’ve hacked around this by only allowing hybrid blocks which
> have easy save/load functionality, but having a simple
> “save_model”/“load_model” function as a 1st class citizen of these proposed
> APIs will lead to a vastly improved user experience down the road.
>
> 2) Allowing the fit/predict/predict_proba functions to take in both data
> loaders and simple numpy arrays and pandas dataframes is a simple change
> but a huge usability improvement. Power users and library authors will
> appreciate being able to use custom data loaders but a large portion of end
> users want to just pass an ndarray or data frame and get some results
> quickly.
>
> 3) Allow lazy construction of the model. This is something I feel TF
> Estimators do well: by allowing the user to pass a function that constructs
> the net (i.e a model_fn that returns the net) rather than the net itself it
> allows for more control at runtime and usage of these APIs in a production
> environment.
>
> Would love your thoughts on these three changes/additions.
>
> —Alfredo Luque
> Software Engineer
> Machine Learning Infrastructure
> Airbnb
> San Francisco, CA
>
> On February 7, 2019 at 1:51:17 PM, Ankit Khedia (khedia.an...@gmail.com)
> wrote:
>
> Hello dev@,
>
> Training a model in Gluon requires users to write the training loop, this
> is useful because of its imperative nature, however repeating the same code
> across multiple models can become tedious and repetitive with boilerplate
> code. The training loop can also be overwhelming to some users new to deep
> learning. Users have asked in [1] for a simple Fit API, similar to APIs
> available in SKLearn and Keras as a way to simplify model training and
> reduce boilerplate code and complexity.
>
> So, I along with other contributor Naveen and Lai came up with a fit API
> proposal in [2] that covers 80% of the use-cases for beginners, the fit API
> does not replace the gluon training loops. The API proposal is inspired by
> the Keras fit API. I have discussed and got feedback from a few MXNet
> contributors (Sheng, Mu, Aston, Zhi) close by and I am writing to ask for
> the community’s feedback on the API proposal.
>
>
>
> [1]
> https://discuss.mxnet.io/t/wrapping-gluon-into-scikit-learn-like-api/2112
> [2]
>
> https://cwiki.apache.org/confluence/display/MXNET/Gluon+Fit+API+-+Tech+Design
>
>
> Thanks,
> Ankit
>
>
> —
> Alfredo Luque
> Software Engineer
> Machine Learning Infrastructure
> Airbnb
> San Francisco, CA
>