Should I write my own network or use a popular framework?

When creating a neural network, should I implement every function as I do in the programming exercises or use a library or framework?

Hey @Seongha_Yi,
You can try to implement every function on your own just as an exercise, in order to make sure that you clearly understand the intricacies behind the different types of functions/layers provided by these frameworks, as being done in the assignment. In general, using a framework is much faster, more optimized, and will make your code much more concise.

Understanding the intricacies is important for 2 reasons. The first being you should know exactly what is happening when you execute 10 lines of code from Tensorflow. This will not only help you to debug the code easily, but will also help you in writing the next Tensorflow or PyTorch if that is something of your interests.

Another reason, let’s say you do some research and comes up with a new layer or loss function. No framework will trivially be providing an implementation for that, so you should know how to write a custom layer/loss function in say Tensorflow or PyTorch, in order to easily integrate it with the already existing layers and/or functions of these frameworks. And some day, Tensorflow will include your implementation, and the learners of DLS will be including it using just a single line of code.

I hope this helps.

Regards,
Elemento

2 Likes

Got it.

Thank you so much for the answer