Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mizutanilab authored Oct 28, 2024
1 parent c7289f0 commit 3c6883e
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions FrontNeurorobot/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
# Bio-mimetic layers

## Code used in our recent paper
Our most recent code is available from <a href="https://github.com/mizutanilab/schizo-nn/tree/master/papercodes">here</a>.

## The original schizophrenia-mimicking layer
# Schizophrenia-mimicking layer
The original schizophrenia-mimicking layer is based on our [study on nanometer-scale 3D structure of neuronal network in schizophrenia cases](https://www.nature.com/articles/s41398-019-0427-4). We translated the findings into newly designed layers that mimic connection constraints in schizophrenia. <BR>

Test calculations using the connection-constraint layer indicated that 80% of weights can be eliminated without any changes in training procedures or network configuration. Very interestingly the connection-constraint layer completely suppresses overfitting and outperforms fully connected layer. Here is a typical example obtained using [this python code](https://github.com/mizutanilab/schizo-nn/blob/master/paperfigs/CIFAR10_CNNSchizo200910.py) with slight changes of num_epoch=200, idlist=\[0.5, 0.0\] and num_repeat=10. Over 60% of kernel weights of convolution layers can be zeroed with the same method without any accuracy loss. This study was published in <a href="http://journal.frontiersin.org/article/10.3389/fnbot.2022.851471/full?&utm_source=Email_to_authors_&utm_medium=Email&utm_content=T1_11.5e1_author&utm_campaign=Email_publication&field=&journalName=Frontiers_in_Neurorobotics&id=851471">Front Neurorobot</a>.<BR><BR>
![training example](FrontNeurorobot/CIFAR_CNN_ConcurrTraj200913.png)
Test calculations using the connection-constraint layer indicated that 80% of weights can be eliminated without any changes in training procedures or network configuration. Very interestingly the connection-constraint layer completely suppresses overfitting and outperforms fully connected layer. Here is a typical example obtained using [this python code](https://github.com/mizutanilab/biomimetic-nn/FrontNeurorobot/CIFAR10_CNNSchizo200910.py) with slight changes of num_epoch=200, idlist=\[0.5, 0.0\] and num_repeat=10. Over 60% of kernel weights of convolution layers can be zeroed with the same method without any accuracy loss. This study was published in <a href="http://journal.frontiersin.org/article/10.3389/fnbot.2022.851471/full?&utm_source=Email_to_authors_&utm_medium=Email&utm_content=T1_11.5e1_author&utm_campaign=Email_publication&field=&journalName=Frontiers_in_Neurorobotics&id=851471">Front Neurorobot</a>.<BR><BR>
![training example](CIFAR_CNN_ConcurrTraj200913.png)

## How to implement the biomimetic layer in your network
## How to implement the schizophrenia-mimicking layer in your network
Our code runs on Tensorflow/Keras. Connection-constraint versions of fully connected layer and 2D convolution layer are available. Their usage is completely the same with official Keras layers, except for specifying parameter reduction ratio and its method. The default reduction ratio is 50%, and the default reduction method is `form='diagonal'`.
1. Download 'schizo.py' (Tensorflow 2.15) file from <a href="https://github.com/mizutanilab/schizo-nn">our repository</a> to your working directory where your *.py file is placed. You can also find schizo.py files for older TF versions (Tensorflow 2.3 and 2.7). If you use them, download one of those versions compatible with your TF environment and rename the 'schizo_tf2.x.py' file to 'schizo.py'.
1. Download 'schizo.py' (Tensorflow 2.15) file from <a href="https://github.com/mizutanilab/biomimetic-nn/FrontNeurorobot/)">our repository</a> to your working directory where your *.py file is placed. You can also find schizo.py files for older TF versions (Tensorflow 2.3 and 2.7). If you use them, download one of those versions compatible with your TF environment and rename the 'schizo_tf2.x.py' file to 'schizo.py'.
2. The following is an example code using a 'SzDense' layer in place of 'Dense' layer:
```
from tensorflow import keras
Expand Down

0 comments on commit 3c6883e

Please sign in to comment.