Functions and utilities to get representations of pytorch/fastai objects.
path = untar_data(URLs.MNIST_TINY)
dls = ImageDataLoaders.from_folder(path)
learn = cnn_learner(dls, resnet18, pretrained=False)
First we want to represent any model as a graph. A graph consists of nodes and links, the nodes will be a collection of nn.Module's and nn.Parameter's, and the links will describe the connections between them.
r = learn.to_representation()
PrettyString(r.data)[:300]
r.to_json()[:300]