Grasshopper

algorithmic modeling for Rhino

While Owl contains some small-scale methods for machine learning, you might want to use more recent deep-learning methods like the ones available in TensorFlow.

The solution is:

  1. Get the data from GH
  2. Pack it all in TensorSets
  3. Export these as IDX file
  4. Import them in Python
  5. Learn/Teach
  6. Move back to GH via IDX as well

IDX is a file format used by the MNIST dataset and majority of machine learning libraries have IDX readers/writers implemented.

You can also read the IDX as numpy arrays via the idx2numpy package.

Views: 1235

Replies to This Discussion

Hello , I feel interest on Owl , 

I hope to get some example to research what can it do ,  :-)  Thanks

Hey, in the folder you're downloading from food4rhino you'll find the 2 very very basic examples of what Owl can do: regression with neural networks and backpropagation, as well as 6D kmeans clustering. For now I know it's not much but I will add more later when I find some time.

Hi Mateusz,

I would be interested to learn more about implementing TensorFlow as it appears to give more options. For step 4 that you describe above couldn't this feasibly be done within GH with the python scripting component?

Sam

Having given this a go (i.e. running TensorFlow within the Python component) I have found the problem...

Iron Python, which is used for the standard Python component is not compatible with TensorFlow. Therefore you could use one of the other Python plugins (which unfortunately I have not had much luck with), OR you could potentially have a general purpose py script which you launch from within GH with (for example) a C# script:

string fileName = @"C:\Users\samg\models\samples\core\get_started\premade_estimator.py";

System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo = new System.Diagnostics.ProcessStartInfo(@"C:\Users\samg\AppData\Local\Programs\Python\Python36\python.exe", fileName)
{
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = false
};
p.Start();

string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();

A = output;

Here is my result from a running the example file provided by TensorFlow:

So in theory you could construct everything from within GH, run it within GH (given a general purpose py script) and extract results within GH.

Hopefully the OWL components will make this much easier to implement.

Ha, just noticed that Mateusz has done something very similar already:

http://www.grasshopper3d.com/video/running-processes-from-gh

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2020   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service