NeuraLegion / shainet

SHAInet - a pure Crystal machine learning library
MIT License
183 stars 19 forks source link

add denormalize #69

Closed drujensen closed 6 years ago

drujensen commented 6 years ago

This PR adds several new methods to help normalize and denormalize the input and output. In order to use a trained model that requires normalization, you need to provide the module normalized inputs. Also, the output will be normalized, so you need to denormalize it to get a proper prediction:

results = model.run(training.normalize_inputs([1.47]))
puts training.denormalize_outputs(results)
bararchy commented 6 years ago

@drujensen This looks fine, can you add a small spec to check the data gets de-normalized correctly?

bararchy commented 6 years ago

Also I believe we just broke your PR, can you fix conflicts ?

drujensen commented 6 years ago

@bararchy I added the tests and cleaned up some of the initialization of the new CNNData that inherits from the Data. I removed the extraneous initializers and called super to call the parent initializer.

bararchy commented 6 years ago

@ArtLinkov It looks great to me, take a look and let me know if were OK to merge here

ArtLinkov commented 6 years ago

@drujensen Looks great, thanks :)