siavashk / imagenet-autoencoder Goto Github PK
View Code? Open in Web Editor NEWAutoencoder trained on ImageNet Using Torch 7
License: MIT License
Autoencoder trained on ImageNet Using Torch 7
License: MIT License
Please see the attached screenshot and focus on the things in the red rectangle. The left one are the weights of decoder filters in the last layer. The right one are the weights of encoder filters in the first layer. They get updated every epoch. I added below display code to https://github.com/siavashk/imagenet-autoencoder/blob/master/scripts/train.lua#L44:
eweight = ae.net.modules[1].weight
dweight = ae.net.modules[19].weight
eweight_view = eweight:float():view(12, 3, 5, 5)
dweight_view = dweight:float():view(12, 3, 5, 5)
de = image.toDisplayTensor{input=eweight_view,
padding=2,
nrow=math.floor(math.sqrt(12)),
symmetric=true}
dd = image.toDisplayTensor{input=dweight_view,
padding=2,
nrow=math.floor(math.sqrt(12)),
symmetric=true}
win1 = image.display{image=dd, win=win1, legend='Decoder filters', zoom=2}
win2 = image.display{image=de, win=win2, legend='Encoder filters', zoom=2}
I change kernel size to 5 so we can get a clearer looking. You can find the decoder layer learned something meaningful, but the encoder layer learned just noise. If I stop the training at this time and test the net. I am pretty sure the learned image would be very similar with the original one according to my previous experiments. Can you give me a little comment on this? Is the encoder part normal?
Hi @siavashk
I have a question, please see line #28:
https://github.com/siavashk/imagenet-autoencoder/blob/master/core/autoencoder.lua#L28
self.net:add(nn.SpatialConvolution(12, 12, 3, 3, 1, 1, 1, 1))
You see, 12 in and 12 out. So we have the same number of the input and the output, what effect will this layer actually do?
Thanks,
Yingjun
self.net:add(nn.Reshape(24 * 16 * 16))
self.net:add(nn.Linear(24 * 16 * 16, 1568))
self.net:add(nn.Linear(1568, 24 * 16 * 16))
self.net:add(nn.Reshape(24, 16, 16))
I removed them and seems network can still be trained.
Hi Siavash,
I made some changes to imagenet-autoencoder and trained it. After some rounds, I get 0.003 for training error and 0.013 for validation error. I feel the gap between them is big, is the autoencoder in overfitting status?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.