Posts

Showing posts from February 13, 2024

[Day 43] Coding up LeNet, VGG, InceptionNet, UNet from scratch

Image
 Hello :) Today is Day 43! Quick summary of today: write LeNet from scratch write VGG from scratch write InceptioNet from scratch write UNet from scratch (again) Wanting to understand the popular models a bit more, I decided to do the above.  1) Let's begin with LeNet .  A basic framework developed in the 1990s, basic but set the groundwork for networks like AlexNet, VGG and ResNet. consists of 2 conv layers, each followed by a maxpool, and then ending with 2 fully connected (linear) layer.  2) Next is VGG The paper proposes numerous versions, VGG11, VGG13, VGG16, VGG19 but from a google search VGG16 seems most popular (version D in the pic). It is deeper than the earlier LeNet, consisting of multiple conv+maxpool layers, each increasing the amount of filters, and decreasing the size of the image.  instead of 1 version, a general model was created so that it can adapt to the desired VGG architecture below is the implementation. I think this is a nice set-up for testing the 4 versio

[Day 42] Creating a UNet with PyTorch

Image
 Hello :)  Today is Day 42! Quick summary of today: Road segmentation with UNet Forest area segmentation with UNet Human segmentation with UNet But why? I can easily load an UNet (well-made UNet, even pretrained) and it will work great on the images I found. Well, I tried to follow the model from yesterday, that was written with TensorFlow, and I just wanted to translate it to PyTorch and use it on new data.  Was my attempt successful? - Not exactly haha  Why ? - Training takes a lot of time. I ran out of free GPU resources and started using CPU (super slow ㅜㅜ). Adjusting the learning rate helped, but adjusting other hyper params can help too, but training time is too long without free GPU hours ㅜㅜ I had 3 attempts on 3 different datasets This is the format that I tried to follow. Model structure: Actually, I followed a TF model and translated it, so a potential issue is that I might have missed or did something in the wrong order. But given that the results are not terrible, such poss