poloclub / cnn-explainer

Learning Convolutional Neural Networks with Interactive Visualization.
https://poloclub.github.io/cnn-explainer/
MIT License
8.1k stars 1.22k forks source link

detail view problem #34

Closed baobobby closed 2 years ago

baobobby commented 2 years ago

I added new layers to the tiny-VGG and got a new model. When I use CNN-Explainer to load this model, there came out the problem:

First there are no more connection lines between two nodes. 屏幕截图 2021-12-02 202752

And after I click a convolutional node(for example conv1 and conv2 ), then no Bias and no former unit convoluntion animation are showed. 屏幕截图 2021-12-02 202834

furthermore I finde that detail view juts doesn't work with those new added layers. 屏幕截图 2021-12-02 205908

I don't know how to fix this problem can anyone help?

xiaohk commented 2 years ago

Hello @baobobby, thank you for using CNN Explainer! Glad to see you are trying your own tiny-vgg model!

The CNN Explainer visualization is tailored to the original architecture of tiny-vgg, so you need to manually update the visualization code if you want to add a new layer.

For example, in the Overview.svelte, you would need to update the layerIndexDict definition, and corresponding variables. It is relatively easier to add a new layer that already exists in CNN Explainer than using a totally different model, but it still requires some effort to make the change in the visualization code.

https://github.com/poloclub/cnn-explainer/blob/b9c1759050033850d4245d1a85bb74c475aa377e/src/overview/Overview.svelte#L141-L154

https://github.com/poloclub/cnn-explainer/blob/b9c1759050033850d4245d1a85bb74c475aa377e/src/overview/Overview.svelte#L202-L215

I would close the issue for now, let me know if you have other questions :)