After importing all the necessary libraries, your first step is to define the network.

Define the network

Create a convolutional neural network with the Linen API by subclassing a module. Because the architecture in this case is relatively simple (you’re just stacking layers), you can define the inlined submodules directly within the __call__ method and wrap it with the @compact decorator.

Get hands-on with 1200+ tech skills courses.