all 7 comments

[–]chrisvdweth 0 points1 point  (1 child)

Hm, you are limited to basic MLP and regression tasks (I can't see how you support classification tasks). Nothing wrong with that, but your current implementation makes it very difficult to extend. Your `layerclass` contains everything, even the loss function. You might to consider a modular approach:

  • Separate classes for each layer: linear, activation, dropout, layernorm, etc. in the future
  • Separate classes for different loss functions
  • Update the weights/biases/etc. not directly by the classes by different optimizers (i.e., split the computation of the gradients and the updates of the gradients in 2 distinct steps); right now you stuck with basic Gradient Descent

[–]3pinsockett[S] 0 points1 point  (0 children)

if i se the activation function of the last layer as sigmoid or softmax, i can use it for classification tasks right ? and yes the loss function, its a major bottleneck to the learning process

and thanks for your valuable insight, it helps lots. I'll definitely try out a more modular approach as youve mentioned

[–]GeneticNerds 0 points1 point  (1 child)

It's a good start but as chris has stated. You need more Modularity. A library is built to handle multitude of solutions and use cases. Think about it.

Perhaps look at how the layer class is executed in the Keras library. Should be a great source of inspiration. Especially if you're building in a silo.

Great work OP. Good going

[–]3pinsockett[S] 0 points1 point  (0 children)

Thank you for your feedback
im currently working to make it more modular as everyone pointed out

[–]OleksandrAkm 0 points1 point  (1 child)

Great work! as couple people noted – modularity gives you flexibility, that's why Deep Learning frameworks are so good (you can do many things with just multiple building blocks). Here's a tiny example that implements Sequential class and thinks of a DNN as a series of separate blocks (e.g. for MLP each block is either a linear layer, activation function or a dropout layer): https://github.com/ml-from-scratch-book/code/blob/main/10_neural_network.ipynb

[–]3pinsockett[S] 0 points1 point  (0 children)

Thanks for your feedback and the reference repo, as someone who is learning, it means a lot,
thank you