Machine Learning and Deep Learning Models from Scratch.
This Library allows users to create the following models:
- Feed-Forward Neural Networks
- Convolution Neural Networks
- Linear Regression
- Logistic Regression
Without having to write any backpropagation code.
To install the Networks Library
pip install networks
No Params
No Params
No Params
No Params
batch_params={ 'mode':'train'/'test', 'momentum':0.9, 'eps':1e-8 }
batch_params={ 'mode':'train'/'test', 'momentum':0.9, 'eps':1e-8 }
pooling_params={ 'pooling_height':2, 'pooling_width':2, 'pooling_stride_height':2, 'pooling_stride_width':2 }
num_kernels=64, kernel_h=3, kernel_w=3, convolution_params={ 'stride':1 }
padding_h=2, padding_w=2
No params
No params
No params
No params
affine_out = 64
No params
from networks.network import network model = network(input_shape=(64,1,50,50),initialization="xavier2", update_params={ 'alpha':1e-3, 'method':'adam', 'epoch':100, 'reg':0.01, 'reg_type':'L2', 'offset':1e-7 })
model.add("padding",padding_h=3,padding_w=3)
model.add("convolution",num_kernels=64,kernel_h=3,kernel_w=3, convolution_params:{ 'stride':1 })
model.add("relu")
model.add("pooling",pooling_params={ "pooling_height":2, "pooling_width":2, "pooling_stride_height":2, 'pooling_stide_width':2 })
model.add("batch_normalization", batch_params={'mode':'train'/'test','momentum':0.9,'eps':1e-8})
model.add("spatial_batch", batch_params={'mode':'train'/'test','momentum':0.9,'eps':1e-8})
model.add("flatten")
model.add("affine",affine_out=128)
model.add("softmax")
model.add("svm")
model.add("mse")
model.add("cross_entropy")
model.save("model.json")
model = network.load("model.json")
model.train(X,y)
accuracy,loss = model.test(validX,validY)
predictions = model.predict(X)