Dimension of feature vectors for classification task in the DCGAN paper
$begingroup$
I am trying to implement one of the section in the DCGAN paper (https://arxiv.org/pdf/1511.06434.pdf) i.e. Using the Discriminator network trained on ImageNet-1k as a feature extractor to classify images in the CIFAR-10 dataset. However, I could not understand how to compute the dimension of 28672 of the feature vectors after concatenating outputs from all convolutional layers of the Discriminator.
I followed the paper and implement a maxpooling layer of size and stride (2, 2) (the paper did not specify this.) after each convolutional layer in the Discriminator network (there are 5 layers in total). However, after concatenating the dimension of the vector that I got is a dimension of $30,720$ as follows:
$$16 times 16 times 64 + 8 times 8 times 128 + 4 times 4 times 256 + 2 times 2 times 512 + 1 times 1 times 1= 16,384 + 8,192 + 4,096 + 2,048 + 1= 30,721.$$
If I just take the 3 first layers, then the dimension is $28,672$ as specified in the paper. However, the authors have said that:
To evaluate the quality of the representations learned by DCGANs for supervised tasks, we train on Imagenet-1k and then use the discriminator’s convolutional features from all layers, maxpooling each layers representation to produce a 4 × 4 spatial grid. These features are then flattened and concatenated to form a 28672 dimensional vector and a regularized linear L2-SVM classifier is trained on top of them.
So I think I have got something wrong. Would anyone please kindly explain for me how to get the dimension of the vectors as mentioned in the paper?
Thank you so much in advance for your help!
convnet feature-extraction convolution gan
New contributor
Sophil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
add a comment |
$begingroup$
I am trying to implement one of the section in the DCGAN paper (https://arxiv.org/pdf/1511.06434.pdf) i.e. Using the Discriminator network trained on ImageNet-1k as a feature extractor to classify images in the CIFAR-10 dataset. However, I could not understand how to compute the dimension of 28672 of the feature vectors after concatenating outputs from all convolutional layers of the Discriminator.
I followed the paper and implement a maxpooling layer of size and stride (2, 2) (the paper did not specify this.) after each convolutional layer in the Discriminator network (there are 5 layers in total). However, after concatenating the dimension of the vector that I got is a dimension of $30,720$ as follows:
$$16 times 16 times 64 + 8 times 8 times 128 + 4 times 4 times 256 + 2 times 2 times 512 + 1 times 1 times 1= 16,384 + 8,192 + 4,096 + 2,048 + 1= 30,721.$$
If I just take the 3 first layers, then the dimension is $28,672$ as specified in the paper. However, the authors have said that:
To evaluate the quality of the representations learned by DCGANs for supervised tasks, we train on Imagenet-1k and then use the discriminator’s convolutional features from all layers, maxpooling each layers representation to produce a 4 × 4 spatial grid. These features are then flattened and concatenated to form a 28672 dimensional vector and a regularized linear L2-SVM classifier is trained on top of them.
So I think I have got something wrong. Would anyone please kindly explain for me how to get the dimension of the vectors as mentioned in the paper?
Thank you so much in advance for your help!
convnet feature-extraction convolution gan
New contributor
Sophil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
add a comment |
$begingroup$
I am trying to implement one of the section in the DCGAN paper (https://arxiv.org/pdf/1511.06434.pdf) i.e. Using the Discriminator network trained on ImageNet-1k as a feature extractor to classify images in the CIFAR-10 dataset. However, I could not understand how to compute the dimension of 28672 of the feature vectors after concatenating outputs from all convolutional layers of the Discriminator.
I followed the paper and implement a maxpooling layer of size and stride (2, 2) (the paper did not specify this.) after each convolutional layer in the Discriminator network (there are 5 layers in total). However, after concatenating the dimension of the vector that I got is a dimension of $30,720$ as follows:
$$16 times 16 times 64 + 8 times 8 times 128 + 4 times 4 times 256 + 2 times 2 times 512 + 1 times 1 times 1= 16,384 + 8,192 + 4,096 + 2,048 + 1= 30,721.$$
If I just take the 3 first layers, then the dimension is $28,672$ as specified in the paper. However, the authors have said that:
To evaluate the quality of the representations learned by DCGANs for supervised tasks, we train on Imagenet-1k and then use the discriminator’s convolutional features from all layers, maxpooling each layers representation to produce a 4 × 4 spatial grid. These features are then flattened and concatenated to form a 28672 dimensional vector and a regularized linear L2-SVM classifier is trained on top of them.
So I think I have got something wrong. Would anyone please kindly explain for me how to get the dimension of the vectors as mentioned in the paper?
Thank you so much in advance for your help!
convnet feature-extraction convolution gan
New contributor
Sophil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
I am trying to implement one of the section in the DCGAN paper (https://arxiv.org/pdf/1511.06434.pdf) i.e. Using the Discriminator network trained on ImageNet-1k as a feature extractor to classify images in the CIFAR-10 dataset. However, I could not understand how to compute the dimension of 28672 of the feature vectors after concatenating outputs from all convolutional layers of the Discriminator.
I followed the paper and implement a maxpooling layer of size and stride (2, 2) (the paper did not specify this.) after each convolutional layer in the Discriminator network (there are 5 layers in total). However, after concatenating the dimension of the vector that I got is a dimension of $30,720$ as follows:
$$16 times 16 times 64 + 8 times 8 times 128 + 4 times 4 times 256 + 2 times 2 times 512 + 1 times 1 times 1= 16,384 + 8,192 + 4,096 + 2,048 + 1= 30,721.$$
If I just take the 3 first layers, then the dimension is $28,672$ as specified in the paper. However, the authors have said that:
To evaluate the quality of the representations learned by DCGANs for supervised tasks, we train on Imagenet-1k and then use the discriminator’s convolutional features from all layers, maxpooling each layers representation to produce a 4 × 4 spatial grid. These features are then flattened and concatenated to form a 28672 dimensional vector and a regularized linear L2-SVM classifier is trained on top of them.
So I think I have got something wrong. Would anyone please kindly explain for me how to get the dimension of the vectors as mentioned in the paper?
Thank you so much in advance for your help!
convnet feature-extraction convolution gan
convnet feature-extraction convolution gan
New contributor
Sophil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Sophil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Sophil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 9 hours ago
SophilSophil
1
1
New contributor
Sophil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Sophil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Sophil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "557"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sophil is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f48887%2fdimension-of-feature-vectors-for-classification-task-in-the-dcgan-paper%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sophil is a new contributor. Be nice, and check out our Code of Conduct.
Sophil is a new contributor. Be nice, and check out our Code of Conduct.
Sophil is a new contributor. Be nice, and check out our Code of Conduct.
Sophil is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Data Science Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f48887%2fdimension-of-feature-vectors-for-classification-task-in-the-dcgan-paper%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown