Here is the code to define ResNet-18 in Matlab using the Deep Learning Toolbox:
main.m822 chars32 lines
Note that in this example, we modified the last layer to have 10 classes (change numClasses
to fit your use case) and froze all the layers except the last fully connected layer, which can help speed up training. Finally, we defined training options and trained the network on some training images.
Keep in mind that training ResNet-18 from scratch may require a lot of computational resources and time.
gistlibby LogSnag