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

How to use this for image retrieval? #18

Open
shaih82 opened this issue Jan 17, 2016 · 0 comments
Open

How to use this for image retrieval? #18

shaih82 opened this issue Jan 17, 2016 · 0 comments

Comments

@shaih82
Copy link

shaih82 commented Jan 17, 2016

I trained dcgan on my own dataset,
and now i want to use this net for image retrieval
now i have the generator network, that takes a length 100 encoding and transform it to an image
is there a simple way to reverse this process, so that i can give an image and get a length 100 encoding?
i tried to reverse the net like so

def gen_inv(X, w, g, b, w2, g2, b2, w3, g3, b3, w4, g4, b4, wx):
    x = dnn_conv(X, wx, subsample=(2, 2), border_mode=(2, 2))
    x = relu(batchnorm(x, g=g4, b=b4))
    x = dnn_conv(x, w4, subsample=(2, 2), border_mode=(2, 2))

    h3 = relu(batchnorm(x, g=g3, b=b3))
    h3 = dnn_conv(h3, w3, subsample=(2, 2), border_mode=(2, 2))

    h2 = relu(batchnorm(h3, g=g2, b=b2))
    h2 = dnn_conv(h2, w2, subsample=(2, 2), border_mode=(2, 2))

    h2 = T.flatten(h2,2)
    h = relu(batchnorm(h2, g=g, b=b))
    h = T.dot(h, w.T)
    return h

but got that for no matter what the input is, i get the same output
so i figured that batchnorm is in training mode, so i tried to remove batchnorm as well
but still got very weird results

any advice?

cheers,
SH

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

No branches or pull requests

1 participant