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, 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

Get Python Reinforcement Learning Projects now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.