ermongroup / mintnet Goto Github PK
View Code? Open in Web Editor NEWMintNet: Building Invertible Neural Networks with Masked Convolutions
MintNet: Building Invertible Neural Networks with Masked Convolutions
Hello! I have really enjoyed reading your paper and want to do some experiments with the invertible network on Cifar-10. However, I think there are some small mistakes with the CIFAR-10 config file, namely that it refers to MNIST and has the wrong image size (28 instead of 32). After rectifying this, I get another error, namely
File "/home/kyle/mintnet/models/cnn_classification.py", line 122, in forward
center2 = center2.permute(0, 2, 1, 3, 4, 5).contiguous().view_as(self.weight2)
RuntimeError: shape '[16, 16, 1, 1]' is invalid for input of size 2304
I'm guessing some other parameter in this config file is not correct, but I couldn't determine which one from the paper. Would you be able to help me figure it out?
Additionally, would you happen to have checkpoints for the trained CIFAR10 model lying around? At least for now, I don't actually need to train a model myself, I just want to use a trained one.
Thanks in advance!
Hi @yang-song
I use the following code to test the BasicBlock, but I found the determinant is always 0. Is this normal? I am looking forward to your reply.
basic_model = BasicBlock(
input_dim=3,
latent_dim=32,
kernel1=3,
kernel2=3,
kernel3=3,
type='A',
config=config,
shape=[3, 32, 32],
init_zero=False,
)
x = torch.randn(1, 3, 32, 32)
log_det = torch.zeros(1)
out, log_det = basic_model([x, log_det])
print(log_det)
Out: tensor([0.], grad_fn=<AddBackward0>)
Hey, thank you for sharing the code. It's great!
I had one query. I have trained a Mintnet model for classification on CIFAR10. Can I use this same model for generating new samples i.e as a generative model (with some code modifications, of course)? If yes, can you suggest what part of the code needs to be changed?
As far as I understood, currently, density estimation and classification experiments are run independently, but I want to make changes to achieve the above use-case.
Thanks in advance!
Hi @yang-song,
Thanks for releasing the code, I really enjoy your paper and would like to use the invertibility in our work.
However, I cannot find the inverse functions in the MintNet class or Mint Block in your code.
Also, how can we reproduce Fig.4a (verification of invertibility)?
Thanks
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.