nip.image_classification.agents#
Image classification agents components.
Contains classes for building agent bodies and heads for the image classification task.
The structure of all agent bodies is the same:
An encoder layer, which takes as input the image and the message history and outputs the initial pixel-level encodings.
A sequence of
num_block_groups
groups of building blocks (e.g. convolutional layers).Each layer is followed by a non-linearity and each group by a max pooling layer.
For each group we halve the output size and double the number of channels.
The number of building blocks in each group is given by the
num_blocks_per_group
parameter.The output of the last group is the ‘latent pixel-level’ representations, which provides a representation for each latent pixel.
We add a channel to the latent pixel-level representations to represent the most recent message.
A global pooling layer, which pools the latent pixel-level representations to obtain the image-level representations.
A representation encoder which takes as input the image-level and latent pixel-level representations and outputs the final representations.
Notes
In all dimension annotations, “channel” refers to the the message channel dimension, which is how different groups of agents can communicate with each other. There is a terminology overlap with the channel dimension in images and convolutional layers. Such channels are called “image_channel” or “latent_channel” to avoid confusion.
Classes
|
An agent for the image classification task. |
|
The body of an image classification agent. |
|
Base class for all image classification agent heads. |
|
Base class for all image classification agent parts. |
|
Agent policy head for the image classification task. |
|
Value head for the image classification task. |
|
A module which combines the agent bodies for the image classification task. |
|
A module which combines the agent policy heads for the image classification task. |
|
A module which combines the agent value heads for the image classification task. |
A constant value head for the image classification task. |
|
|
Dummy agent body for the image classification task. |
|
Base class for all image classification dummy agent parts. |
Policy head for the image classification task yielding a uniform distribution. |
|
|
Solo agent head for the image classification task. |