Sklearn MLPRegressor to FluidMLPRegressor (json)

Ciao,

I was doing some training in sklearn and realized that it may be possible to just package the parameters of the sklearn MLPRegressor to write a Fluid-style json for the MLPRegressor. Here’s the code. It seems to be working well. Maybe it’s helpful for others.

Cheers,
T

1 Like

What’s the advantage or reason (from your perspective) of doing your training in sklearn, if you don’t mind me asking?

Partially it’s because I had some existing code there that loaded in my csv files and parsed them how I wanted, etc.

But also, there is some stuff that is easier to do in Python than in other places, mainly because of all of the sklearn packages, like some data manipulation utilities that aren’t implemented in Fluid stuff yet (randomly splitting a dataset into train and test sets and other numpy-like stuff). Also, the server client management in SC can be annoying when trying to train many MLPs for example–lots of callback functions, server syncing, buffer filling, and the like, where in Python it’s more straight ahead sequential code.

However, the MLP training is faster in FluCoMa than it is in sklearn, which makes sense. I don’t think sklearn is better just different. In the long run I’m planning to be primarily in SC, but the two do feel different, those are some thoughts.

2 Likes

A particular thing might be that there are many more tools for doing validation of learnt models available in sklearn, and python more generally.

Also, if people start wanting to train some much more chunky models and just use FluCoMa stuff at runtime, it may be practical to lease processing time from google for training or whoever and use a python library for that.

Espectially when someone says that ‘you can even train your own dataset in 2 to 4 days’ here:

You would think in today’s current news climate you would not succumb to such Murdoch style editorial sniper shots of my words :stuck_out_tongue: