Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/neurals-ro/keras-model-viewer
Keras Model viewable as an SVG diagram
https://github.com/neurals-ro/keras-model-viewer
diagram javascript keras keras-models neural-network npm svg
Last synced: 3 months ago
JSON representation
Keras Model viewable as an SVG diagram
- Host: GitHub
- URL: https://github.com/neurals-ro/keras-model-viewer
- Owner: neurals-ro
- License: mit
- Created: 2016-12-06T11:06:01.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-24T00:55:47.000Z (over 7 years ago)
- Last Synced: 2024-10-05T11:49:47.948Z (3 months ago)
- Topics: diagram, javascript, keras, keras-models, neural-network, npm, svg
- Language: JavaScript
- Homepage:
- Size: 417 KB
- Stars: 10
- Watchers: 5
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# keras-model-viewer
View a Keras Model Object as a nice diagram with enabled zooming.
See example: https://neurals-ro.github.io/keras-model-viewer/examples/index.html
There is also a Keras model editor tool: https://github.com/neurals-ro/keras-model-editor, with an example at https://neurals-ro.github.io/keras-model-editor/examples/index.html
## How to use
See `examples` folder.
```
npm i keras-model-viewer```
```
new KerasModelViewer( kerasModelObject, elementId);new KerasModelViewer( kerasModelObject, document.getElementById(elementId));
new KerasModelViewer( kerasModelObject, document.getElementById(elementId), {
"rankdir": "LR", // "LR" "UD"
"nodesep": 20,
"edgesep": 20,
"ranksep": 40,
"marginx": 0,
"marginy": 0
});```
### Example
```
``````
let model = new KerasModelViewer( kerasModelObject, 'kerasmodel', {
"rankdir": "LR", // "LR" "UD"
"nodesep": 20,
"edgesep": 20,
"ranksep": 40,
"marginx": 0,
"marginy": 0
});
model.show();```
## API
`KerasModelViewer.show()` - renders the SVG diagram
`KerasModelViewer.clear()` - removes the SVG diagram
`KerasModelViewer.model([newJSON])` - re-renders the SVG diagram; if new model provided, it renders the new model## Known Bugs
- Does not work with all versions of Keras models (does not work with Keras ver. ^2.0.0)## We would love to know how to improve this
This is in pre-alpha stage but still usable. Let us know what features you would like to see in version 1.## License
MIT