Despite the fact that machine learning plays a crucial part in advancing the tech industry, many developers view it as intimidating due to its complexity, which consequently discourages many developers from engaging with it. To address the problem, Google’s Brain Team developed TensorFlow.js in 2018 to help bring machine learning to JavaScript developers with little to no experience in machine learning. While TensorFlow.js is simplified, it lacks direct support for Tensorboard, the visualization tool for its counterpart, TensorFlow.
Our team’s core mission was to develop a real time model and data visualization tool for TensorFlow.js that requires minimal set-up by the developer while simultaneously providing them with all the necessary information required to fully comprehend their machine learning model. This allows the developer to make well informed decisions in regards to how they need to alter their model to improve accuracy while lowering the required number of epochs per training cycle. This led the team to develop FlowSpace, a light-weight npm package that generates highly valuable data and intuitive visuals whilst remaining effortless to set-up.
FlowSpace is developed using agile methodology in collaboration with the tech accelerator OS Labs (opensourcelabs.io)
Table of Contents
Install and Set-up
- Install our npm package in your terminal.
npm install flowspace.js
- Import HandShake class from the FlowSpace node_modules.
import { HandShake } from "flowspace";
- Declare your variable for the TensorFlow createModel function.
const model = createModel();
- Instantiate a new instance of the HandShake class, passing in your model object.
const visualizer = new HandShake(model);
- Ensure when training the model, pass the lossCallback method from the HandShake instance into the fit method.
## Example below ##
model.fit(trainingFeatureTensor, trainingLabelTensor, {
epochs: 20,
callbacks: {
onEpochEnd: visualizer.lossCallback
},
});
- When ready, simply run the FlowSpace functionality in your terminal.
npx flowspace
License
MIT License
Copyright (c) 2022 OSLabs Beta
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.