O'Reilly logo

Python Reinforcement Learning Projects by Rajalingappaa Shanmugamani, Yang Wenzhuo, Sean Saito

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

child_network.py

We will first implement our child network module. This module contains a class called ChildCNN, which constructs a child network given some architecture configuration, which we call cnn_dna. As mentioned previously, cnn_dna is simply a list of numbers, with each value representing a parameter of its respective convolutional layer. In our config.py, we specify the max number of layers a child network can have. For our implementation, each convolutional layer is represented by four parameters, where each corresponds to the kernel size, stride length, number of filters, and subsequent max-pooling window size.

Our ChildCNN is a class that takes the following parameters in its constructor:

  • cnn_dna: The network architecture

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required