-
Notifications
You must be signed in to change notification settings - Fork 51
CNN #442
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
Open
pobonomo
wants to merge
15
commits into
Gurobi:main
Choose a base branch
from
pobonomo:cnn
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
CNN #442
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
Author
|
Test are failing because I had to deactivate all the code to test the dimensions of input and output of models and layers. This code is too naive for convolutional networks |
Started doing a convolutional net with keras. notebooks/adversarial/adversarial_cnn.ipynb contains a working example that we would want to model with gurobi_ml A conv2d layer is in progress (doesn't crash and does something). The big mess now is variable dimensions. Gurobi ML was more or less designed around the idea that the input of the ML model is 2-d (n_examples, n_features) but of course convolutional layers are 4-d (n_examples, height, width, n_channels) The 2d assumption is all other the place... Missing layers: - MaxPooling - Dropout - Flatten Also for the conv2d only did with valid padding and the for loop is
Let's see if chat gpt can do the max pooling and flatten layers
We get something unsolvable on my example :-()
A very tiny one without pooling layers. A less tiny with pooling. Right now I need to cheat on the bounds of the input layer.
The layer is flattened in different orders in pytorch and tensorflow adapt it.
This is still a somewhat lazy approach where we don't differentiate the dimension of the input and the output.
We have to respect shapes now
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Try to do convolutional networks.
Implemented a 2D convolution (maybe correct)
and 2D max pooling.
Have two notebooks where it works (kinda 2D max pooling is really tough for MIP it seems)