Skip to content

Add a CNN to networks #5

@quantumjot

Description

@quantumjot

We routinely use CNNs for image classification. We should add a generic classifier to networks. We can use the layers.Encoder2D to build the model of arbitrary size/architecture, and then reduce to a dense layer with N outputs. The final layer should be the raw unscaled logits.

So we could build something like this:

class CNNClassifier(K.Model):
    def __init__(self, encoder: layers.Encoder, outputs: int = 5):
        super().__init__()
        self.encoder = encoder
        self.outputs = outputs

This would be a subclass of the Keras Model as described in the docs. In this way, we could build CNNs with arbitrary encoder networks, that reduce to a one-hot or binary classification output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions