ladybug-tools / honeybee-dynamo

:honeybee: :blue_book: Honeybee library and plugin for Dynamo
GNU General Public License v3.0
17 stars 8 forks source link

[Request]: Export results in a tensor format #60

Closed TheodoreGalanos closed 6 years ago

TheodoreGalanos commented 7 years ago

Hello everyone!

I was wondering if I could leave this here for future reference. I would love it if HB (and LB as well) could output the results, of all types of simulations that have a result mesh, in a kind of tensor, or rather matrix, format. At the moment, the results come out normally as a list, apart from the mesh. I think this could be done in two ways (I'm not including the numpy way since it has issues):

  1. Link perhaps to Owl plug in which introduces the tensor data structure to GH. I have no idea if this works I have yet to try Owl. Also, it would result in an external dependency on another plug in so I don't think it's ideal. But I leave it here as an option.
  2. Export mesh results as a python matrix structure, keeping the spatial information of results (this is crucial).

As a side note, I want to note that I am already able to do the second but with native GH tricks, exporting results in Excel sheets (bleh). This is as you can imagine extremely inefficient. It would be lovely to do all this, which is really quite simple, within LB tools in Python. This would be a pretty cool step towards better integration of Machine Learning and LB Tools!

Would love to hear your thoughts, I'm sure I'm missing something easier/simpler on this.

Kind regards, Theodore.

mostaphaRoudsari commented 7 years ago

@TheodoreGalanos can you share a simple example in a kind of tensor, or rather matrix, format for a sample honeybee result? Generating data structures is usually the most straight forward part of the process and I wonder if the results of multi-phase daylight analysis is already structured as you want it to be.

TheodoreGalanos commented 6 years ago

Damn I kind of forgot about this one, sorry!

A tensor would be a n-dimensional array much like an nd-array in numpy. For example, you can image a tensor that allows images to be represented as: (x_pos, y_pos, color_value, class).

For daylighting the color value would relate of course to the actual result for whatever metric we calculated in the process. The class of the image should be set by the user. Again for our daylighting example, the class could be set in advance (through the filename input of the component) and be related to some kind of inputs (e.g. louver_1m, louver_2m, no_louver) or be assigned in the output according to the result of the component, eg. compliant vs non-compliant, or DGP_0, DGP_1, etc., for a multi-classification problem.

Hope this makes sense. I would also like to note that with the development of CPython or gh-python-remote, this can also be done through numpy. But it would be smth to think of integrating into (new?)components.

Kind regards, Theodore.

TheodoreGalanos commented 6 years ago

image

mostaphaRoudsari commented 6 years ago

@TheodoreGalanos thank you for the update. I agree that this can be very useful but it may not really fit the core honeybee functionalities. What if we write a script to do that similar to what you have done in your code but don't include it in the core library?

TheodoreGalanos commented 6 years ago

@mostaphaRoudsari yeah I think that is ok. It's a bit of a risk cause we'd need to rely on external libraries linking to python or C# (like in Owl).

I still need to find some time and run a glare+convolutional network study which will require this. With the colour values output of the image viewer now ready, this could be pretty cool.

TheodoreGalanos commented 6 years ago

@mostaphaRoudsari yeah I think that is ok. It's a bit of a risk cause we'd need to rely on external libraries linking to python or C# (like in Owl).

I still need to find some time and run a glare+convolutional network study which will require this. With the colour values output of the image viewer now ready, this could be pretty cool.

I'll reopen this when I do, think it isn't an issue anymore.