Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a CNN to networks #5

Open
quantumjot opened this issue Oct 26, 2020 · 1 comment
Open

Add a CNN to networks #5

quantumjot opened this issue Oct 26, 2020 · 1 comment
Labels
feature New feature or request

Comments

@quantumjot
Copy link
Owner

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.

@quantumjot quantumjot added the feature New feature or request label Oct 26, 2020
@quantumjot quantumjot linked a pull request Oct 30, 2020 that will close this issue
@quantumjot
Copy link
Owner Author

We should finish off this PR, so that we can simply import the classifier network from the cellx library in the cnn-annotator notebooks.

Also, we should add the option discussed here: lowe-lab-ucl/cnn-annotator#28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant