ml5-library
ml5-library copied to clipboard
🧹 NeuralNetwork cleanup pt. 2 -- data loading
Extends some others PRs which should be merged first: #1407 #1388
This is primarily a cleanup of the internal workings of the NeuralNetworkData class. Step 2 of many.
- Move file loading functions which are not NN-specific to utils/io.
- Move the logic for finding the data array into a new file
loadData
. This might be temporary. I would have put it in the nnUtils but that is a class for no reason. - Prefer accessing instance properties like
this.data.raw
rather than passing them around as arguments. - Modified a bunch of internal NeuralNetworkData methods such that they just set/update the class properties and don't return anything.
Possibly breaking changes:
- MIME type for JSON files changed from
text/plain
toapplication/json
. -
nn.normalizeData
no longer accepts an argument or returns a value.