-
Notifications
You must be signed in to change notification settings - Fork 38
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
Issue 149: VGG-like Convolutional Neural Network Classifier #152
Merged
csala
merged 5 commits into
MLBazaar:master
from
Hector-hedb12:issue_149_vgg_like_convnet
Apr 20, 2019
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7b2666b
add `keras.Sequential.VGGCNNClassifier` primitive
Hector-hedb12 78a563c
create pipeline for `keras.Sequential.VGGCNNClassifier` primitive
Hector-hedb12 3a68063
remove `batch_size` tunable parameter
Hector-hedb12 904a33c
add `verbose` fixed parameter
Hector-hedb12 24c9abd
default `verbose` to 0
Hector-hedb12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
268 changes: 268 additions & 0 deletions
268
mlprimitives/jsons/keras.Sequential.VGGCNNClassifier.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,268 @@ | ||
{ | ||
"name": "keras.Sequential.VGGCNNClassifier", | ||
"contributors": [ | ||
"Hector Dominguez <[email protected]>" | ||
], | ||
"description": "VGG-like Convolutional Neural Network Classifier", | ||
"classifiers": { | ||
"type": "estimator", | ||
"subtype": "classifier" | ||
}, | ||
"modalities": [], | ||
"primitive": "mlprimitives.adapters.keras.Sequential", | ||
"fit": { | ||
"method": "fit", | ||
"args": [ | ||
{ | ||
"name": "X", | ||
"type": "ndarray" | ||
}, | ||
{ | ||
"name": "y", | ||
"type": "array" | ||
}, | ||
{ | ||
"name": "classes", | ||
"type": "int", | ||
"description": "Number of classes" | ||
} | ||
] | ||
}, | ||
"produce": { | ||
"method": "predict", | ||
"args": [ | ||
{ | ||
"name": "X", | ||
"type": "ndarray" | ||
} | ||
], | ||
"output": [ | ||
{ | ||
"name": "y", | ||
"type": "array" | ||
} | ||
] | ||
}, | ||
"hyperparameters": { | ||
"fixed": { | ||
"classification": { | ||
"type": "bool", | ||
"default": true | ||
}, | ||
"conv2d_1_filters": { | ||
"type": "int", | ||
"default": 32 | ||
}, | ||
"input_shape": { | ||
"type": "list", | ||
"default": [ | ||
224, | ||
224, | ||
3 | ||
] | ||
}, | ||
"conv2d_2_filters": { | ||
"type": "int", | ||
"default": 32 | ||
}, | ||
"conv2d_3_filters": { | ||
"type": "int", | ||
"default": 32 | ||
}, | ||
"conv2d_4_filters": { | ||
"type": "int", | ||
"default": 32 | ||
}, | ||
"loss": { | ||
"type": "str", | ||
"default": "keras.losses.categorical_crossentropy" | ||
}, | ||
"optimizer": { | ||
"type": "str", | ||
"default": "keras.optimizers.SGD" | ||
}, | ||
"metrics": { | ||
"type": "list", | ||
"default": [ | ||
"accuracy" | ||
] | ||
}, | ||
"epochs": { | ||
"type": "int", | ||
"default": 20 | ||
}, | ||
"layers": { | ||
"type": "list", | ||
"default": [ | ||
{ | ||
"class": "keras.layers.Conv2D", | ||
"parameters": { | ||
"filters": "conv2d_1_filters", | ||
"kernel_size": "conv2d_1_kernel_size", | ||
"activation": "relu", | ||
"input_shape": "input_shape" | ||
} | ||
}, | ||
{ | ||
"class": "keras.layers.Conv2D", | ||
"parameters": { | ||
"filters": "conv2d_2_filters", | ||
"kernel_size": "conv2d_2_kernel_size", | ||
"activation": "relu" | ||
} | ||
}, | ||
{ | ||
"class": "keras.layers.MaxPooling2D", | ||
"parameters": { | ||
"pool_size": "maxpooling2d_1_pool_size" | ||
} | ||
}, | ||
{ | ||
"class": "keras.layers.Dropout", | ||
"parameters": { | ||
"rate": "dropout_1_rate" | ||
} | ||
}, | ||
{ | ||
"class": "keras.layers.Conv2D", | ||
"parameters": { | ||
"filters": "conv2d_3_filters", | ||
"kernel_size": "conv2d_3_kernel_size", | ||
"activation": "relu" | ||
} | ||
}, | ||
{ | ||
"class": "keras.layers.Conv2D", | ||
"parameters": { | ||
"filters": "conv2d_4_filters", | ||
"kernel_size": "conv2d_4_kernel_size", | ||
"activation": "relu" | ||
} | ||
}, | ||
{ | ||
"class": "keras.layers.MaxPooling2D", | ||
"parameters": { | ||
"pool_size": "maxpooling2d_2_pool_size" | ||
} | ||
}, | ||
{ | ||
"class": "keras.layers.Dropout", | ||
"parameters": { | ||
"rate": "dropout_2_rate" | ||
} | ||
}, | ||
{ | ||
"class": "keras.layers.Flatten", | ||
"parameters": {} | ||
}, | ||
{ | ||
"class": "keras.layers.Dense", | ||
"parameters": { | ||
"units": "dense_units", | ||
"activation": "relu" | ||
} | ||
}, | ||
{ | ||
"class": "keras.layers.Dropout", | ||
"parameters": { | ||
"rate": "dropout_3_rate" | ||
} | ||
}, | ||
{ | ||
"class": "keras.layers.Dense", | ||
"parameters": { | ||
"units": "classes", | ||
"activation": "softmax" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"tunable": { | ||
"conv2d_1_kernel_size": { | ||
"type": "int", | ||
"default": 3, | ||
"range": [ | ||
3, | ||
10 | ||
] | ||
}, | ||
"conv2d_2_kernel_size": { | ||
"type": "int", | ||
"default": 3, | ||
"range": [ | ||
3, | ||
10 | ||
] | ||
}, | ||
"maxpooling2d_1_pool_size": { | ||
"type": "int", | ||
"default": 2, | ||
"range": [ | ||
2, | ||
10 | ||
] | ||
}, | ||
"dropout_1_rate": { | ||
"type": "float", | ||
"default": 0.0, | ||
"range": [ | ||
0.0, | ||
0.75 | ||
] | ||
}, | ||
"conv2d_3_kernel_size": { | ||
"type": "int", | ||
"default": 3, | ||
"range": [ | ||
3, | ||
10 | ||
] | ||
}, | ||
"conv2d_4_kernel_size": { | ||
"type": "int", | ||
"default": 3, | ||
"range": [ | ||
3, | ||
10 | ||
] | ||
}, | ||
"maxpooling2d_2_pool_size": { | ||
"type": "int", | ||
"default": 2, | ||
"range": [ | ||
2, | ||
10 | ||
] | ||
}, | ||
"dropout_2_rate": { | ||
"type": "float", | ||
"default": 0.0, | ||
"range": [ | ||
0.0, | ||
0.75 | ||
] | ||
}, | ||
"dense_units": { | ||
"type": "int", | ||
"default": 64, | ||
"range": [ | ||
1, | ||
500 | ||
] | ||
}, | ||
"dropout_3_rate": { | ||
"type": "float", | ||
"default": 0.5, | ||
"range": [ | ||
0.0, | ||
0.75 | ||
] | ||
}, | ||
"batch_size": { | ||
"type": "int", | ||
"default": 128 | ||
} | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"metadata": { | ||
"name": "keras.Sequential.VGGCNNClassifier", | ||
"data_type": "image", | ||
"task_type": "classification" | ||
}, | ||
"validation": { | ||
"dataset": "usps", | ||
"context": {} | ||
}, | ||
"primitives": [ | ||
"mlprimitives.custom.counters.UniqueCounter", | ||
"keras.Sequential.VGGCNNClassifier" | ||
], | ||
"input_names": { | ||
"mlprimitives.custom.counters.UniqueCounter#1": { | ||
"X": "y" | ||
} | ||
}, | ||
"output_names": { | ||
"mlprimitives.custom.counters.UniqueCounter#1": { | ||
"counts": "classes" | ||
} | ||
}, | ||
"init_params": { | ||
"mlprimitives.custom.counters.UniqueCounter#1": { | ||
"add": 1 | ||
}, | ||
"keras.Sequential.VGGCNNClassifier#1": { | ||
"epochs": 1 | ||
} | ||
} | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
batch_size
is currently ignored by the keras adapter, so this line can be removed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3a68063