项目作者: Mayukhdeb

项目描述 :
Tiny neural net library written from scratch with cupy :warning: under construction :warning:
高级语言: Python
项目地址: git://github.com/Mayukhdeb/patrick.git
创建时间: 2020-12-16T17:59:19Z
项目社区:https://github.com/Mayukhdeb/patrick

开源协议:

下载


patrick

Spongebob’s best friend

Tiny neural net library written from scratch with cupy backend (sorry CPU gang). Still under construction.



  1. from patrick.nn import NN as nn
  2. from patrick.losses import mse_loss
  3. from patrick.activations import leaky_relu
  4. from patrick.layers import FCLayer as linear
  5. """
  6. Load and preprocess your data here
  7. """
  8. class Model(nn):
  9. def __init__(self):
  10. self.layers = [
  11. linear(64,32), ## input size is 64
  12. leaky_relu(),
  13. linear(32, 16),
  14. leaky_relu(),
  15. linear(16,1) ## output size is 1
  16. ]
  17. net = Model()
  18. net.fit(
  19. x_train, ## your input features, shape: (num_batches, batch_size, input_size)
  20. y_train, ## your labels, shape: (num_batches, batch_size, output_size)
  21. epochs=60,
  22. learning_rate=0.005,
  23. loss = mse_loss
  24. )

“The best way to learn how something works is to make it from scratch”


-Probably Someone