Skip to content

ISosnovik/nets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Nets

It is an easy-to-use framework for drawing your favorite network's architecture. It is inspired by the juicy schemas from SegNet

Usage

The API is close to this of Keras

You don't have to think about filter size, strides and activation function. It is all about shapes, colors and fonts.

from nets.PlaneLayer import *
from nets.neural_net import NN

nn = NN()

# Encoder
nn.add(Conv2D())
nn.add(Conv2D())
nn.add(Pooling(pool_size=2))

nn.add(Conv2D())
nn.add(Conv2D())
nn.add(Pooling(pool_size=2))

nn.add(Conv2D())
nn.add(Conv2D())
nn.add(Conv2D())
nn.add(Pooling(pool_size=2))

# Decoder
nn.add(Upsampling(factor=2))
nn.add(Conv2D())
nn.add(Conv2D())
nn.add(Conv2D())

nn.add(Upsampling(factor=2))
nn.add(Conv2D())
nn.add(Conv2D())

nn.add(Upsampling(factor=2))
nn.add(Conv2D())
nn.add(Conv2D())

nn.add(Conv2D())

To draw the net, the architecture should be processed

nn.compile()
nn.add_legend(bbox_to_anchor=(0.2, -0.1, 0.6, 0.1), fontsize=26)
nn.draw()

Pretty simple. That's it

img