Installation
Pre-requsites:
- numpy, scipy
- theano
- matplotlib, networkx (plotting neural networks)
Install Hat using pip (recommanded)
$ pip install hat
For updating the package, you can specify upgrade argument
$ pip install hat --upgrade
Using Source Code
You can use the source code without installation https://github.com/qiuqiangkong/Hat. You need to add following code to append path in every file you use Hat.
import sys
sys.path.append('xxx/Hat')
Write your first NN
Once you have installed Hat, you can use the following code to build your first NN.
from hat.layers.core import InputLayer, Dense, Dropout
from hat.models import Sequential
seq = Sequential()
seq.add( InputLayer(784) )
seq.add( Dense( n_out=500, act='tanh' ) )
seq.add( Dense( n_out=10, act='softmax' ) )
md = seq.combine()
Congratulations! You have finished your first neural network! But we have not use data to trian it yet. Next section will show how to do write a real digit recognition program. Please click Mnist Recognition.