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

Added and updated README files for vision models #218 #305

Merged
merged 48 commits into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
e02cfe4
Added abspath for terminal support
aditkumar72 Jun 12, 2021
936871c
Added README files and abspath support to code
aditkumar72 Jun 12, 2021
bd62093
Added README files
aditkumar72 Jun 12, 2021
3215e2b
Updated README.md for cdcgan_mnist
aditkumar72 Jun 13, 2021
ce19dca
Added image for readme
aditkumar72 Jun 13, 2021
dbba92c
created docs file for readme imgs
aditkumar72 Jun 13, 2021
83edc50
Updated Readme.md for conv_mnist
aditkumar72 Jun 13, 2021
0bfef8d
Updated dcgan_mnist readme
aditkumar72 Jun 13, 2021
ce52bba
Added mlp img in docs folder
aditkumar72 Jun 13, 2021
b67e5d2
Updated README.md for mlp_mnist
aditkumar72 Jun 13, 2021
35996b7
Added vgg img in docs folder
aditkumar72 Jun 13, 2021
bc29baa
Updated README.md for vgg_cifar10
aditkumar72 Jun 13, 2021
04c0d83
Addes vae img in docs folder
aditkumar72 Jun 13, 2021
0116bc9
Updated README.md for vae_mnist
aditkumar72 Jun 13, 2021
cd686c4
Updated vae_mnist README
aditkumar72 Jun 13, 2021
7f8a3da
Update vision/cdcgan_mnist/cGAN_mnist.jl
aditkumar72 Jun 16, 2021
8a5b7e6
Update vision/vae_mnist/README.md
aditkumar72 Jun 16, 2021
3466de1
Update cdcgan_mnist README
aditkumar72 Jun 16, 2021
20e5bb9
Update conv_mnist README
aditkumar72 Jun 16, 2021
0b3ecdb
Update dcgan_mnist README
aditkumar72 Jun 16, 2021
f9a42fe
Update mlp_mnist README
aditkumar72 Jun 16, 2021
4790b63
Update vgg_cifar10 README
aditkumar72 Jun 16, 2021
69c3897
Removed cd from cGAN_mnist.jl
aditkumar72 Jun 16, 2021
f1c9c02
Added newline in cGAN_mnist
aditkumar72 Jun 16, 2021
48fc214
Added newline to conv_mnist
aditkumar72 Jun 16, 2021
83571b6
Added dcgan_generator_discriminator.png for readme
aditkumar72 Jun 16, 2021
9cc9250
Updated dcgan_mnist README
aditkumar72 Jun 16, 2021
0916e55
Removed `cd` from dcgan_mnist and added newline
aditkumar72 Jun 16, 2021
d7751ce
Added newline to mlp_mnist
aditkumar72 Jun 16, 2021
228e9c3
Added newline to vae_mnist
aditkumar72 Jun 16, 2021
fb4aa56
Added newline to vgg_cifar10
aditkumar72 Jun 16, 2021
3289e2f
Updated model info of VAE
aditkumar72 Jun 16, 2021
170fefe
Updated vae_mnist README
aditkumar72 Jun 18, 2021
64c8ac5
Updated vae_mnist README
aditkumar72 Jun 18, 2021
7064bbf
Updated cdcgan_mnist README
aditkumar72 Jun 18, 2021
8f0d12d
Updated conv_mnist README
aditkumar72 Jun 18, 2021
5de75fa
Updated dcgan_mnist README
aditkumar72 Jun 18, 2021
87e70f1
Updated mlp_mnist README
aditkumar72 Jun 18, 2021
944a8d3
Updated mlp_mnist README
aditkumar72 Jun 18, 2021
7d1b846
Updated mlp_mnist README
aditkumar72 Jun 18, 2021
823b274
Updated conv_mnist README
aditkumar72 Jun 18, 2021
8021b8f
Updated vgg_cifar10 README
aditkumar72 Jun 18, 2021
b35c585
Update vision/vae_mnist/README.md
aditkumar72 Jun 21, 2021
b7bb761
corrected path in cdcgan_mnist
aditkumar72 Jun 21, 2021
7930c10
updated dcgan_mnist readme
aditkumar72 Jun 21, 2021
390692f
updated dcgan_mnist README
aditkumar72 Jun 21, 2021
ebcd810
made needed changes
aditkumar72 Sep 27, 2021
d7ad415
made needed changes
aditkumar72 Sep 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions vision/cdcgan_mnist/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Conditional DCGAN

<img src="..\cdcgan_mnist\output\img_for_readme.png" width="440"/>
CarloLucibello marked this conversation as resolved.
Show resolved Hide resolved

## Model Info

Generative Adversarial Networks have two models, a _Generator model G(z)_ and a _Discriminator model D(x)_, in competition with each other. G tries to estimate the distribution of the training data and D tries to estimate the probability that a data sample came from the original training data and not from G. During training, the Generator learns a mapping from a _prior distribution p(z)_ to the _data space G(z)_. The discriminator D(x) produces a probability value of a given x coming from the actual training data.
This model can be modified to include additional inputs, y, on which the models can be conditioned. y can be any type of additional inputs, for example, class labels. _The conditioning can be achieved by simply feeding y to both the Generator — G(z|y) and the Discriminator — D(x|y)_.

## Training

```shell
cd vision/cdcgan_mnist
julia --project cGAN_mnist.jl
```

## Results

1000 training step

![1000 training step](../cdcgan_mnist/output/cgan_steps_001000.png)

3000 training step

![30000 trainig step](../cdcgan_mnist/output/cgan_steps_003000.png)

5000 training step

![5000 training step](../cdcgan_mnist/output/cgan_steps_005000.png)

10000 training step

![10000 training step](../cdcgan_mnist/output/cgan_steps_010000.png)

11725 training step

![11725 training step](../cdcgan_mnist/output/cgan_steps_011725.png)

## References

[Conditional Generative Adversarial Nets by Mehdi Mirza et al.](https://arxiv.org/pdf/1411.1784.pdf)

[Medium](https://medium.com/@utk.is.here/training-a-conditional-dc-gan-on-cifar-10-fce88395d610)
7 changes: 5 additions & 2 deletions vision/cdcgan_mnist/cGAN_mnist.jl
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,8 @@ function train(; kws...)
return Flux.onecold.(cpu(fixed_labels))
end

cd(@__DIR__)
fixed_labels = train()
if abspath(PROGRAM_FILE) == @__FILE__
train()
end


Binary file added vision/cdcgan_mnist/output/img_for_readme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions vision/conv_mnist/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# LeNet-5

![LeNet-5](../conv_mnist/docs/LeNet-5.png)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this image come from? Does it require attribution?


## Model Info

At a high level LeNet (LeNet-5) consists of two parts:
(i) _a convolutional encoder consisting of two convolutional layers_;
(ii) _a dense block consisting of three fully-connected layers_

The basic units in each convolutional block are a convolutional layer, a sigmoid activation function, and a subsequent average pooling operation. Each convolutional layer uses a 5×5 kernel and a sigmoid activation function. These layers map spatially arranged inputs to a number of two-dimensional feature maps, typically increasing the number of channels. The first convolutional layer has 6 output channels, while the second has 16. Each 2×2 pooling operation (stride 2) reduces dimensionality by a factor of 4 via spatial downsampling. The convolutional block emits an output with shape given by (batch size, number of channel, height, width).

## Training

```shell
cd vision/conv_mnist
julia --project conv_mnist.jl
```

## Reference
CarloLucibello marked this conversation as resolved.
Show resolved Hide resolved

[Gradient-Based Learning Applied to Document Recognition by Yann LeCun et al.](http://yann.lecun.com/exdb/publis/pdf/lecun-01a.pdf)
CarloLucibello marked this conversation as resolved.
Show resolved Hide resolved

[d2l.ai](https://d2l.ai/chapter_convolutional-neural-networks/lenet.html)
5 changes: 4 additions & 1 deletion vision/conv_mnist/conv_mnist.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,7 @@ function train(; kws...)
end
end

train()
if abspath(PROGRAM_FILE) == @__FILE__
train()
end

Binary file added vision/conv_mnist/docs/LeNet-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions vision/dcgan_mnist/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Deep Convolutional GAN

![dcgan_gen_disc](../dcgan_mnist/output/dcgan_generator_discriminator.png)

## Model Info

A DCGAN is a direct extension of the GAN, except that it explicitly uses convolutional and convolutional-transpose layers in the discriminator and generator, respectively. _The discriminator is made up of strided convolution layers, batch norm layers, and LeakyReLU activations_. The input is a 3x64x64 input image and the output is a scalar probability that the input is from the real data distribution. _The generator is comprised of convolutional-transpose layers, batch norm layers, and ReLU activations_. The input is a latent vector, _z_, that is drawn from a standard normal distribution and the output is a 3x64x64 RGB image. The strided conv-transpose layers allow the latent vector to be transformed into a volume with the same shape as an image.
CarloLucibello marked this conversation as resolved.
Show resolved Hide resolved

## Training

```script
cd vision/dcgan_mnist
julia --project dcgan_mnist.jl
```

## Results

2000 training step
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"steps" should be plural here as well.


![2000 training steps](../dcgan_mnist/output/dcgan_steps_002000.png)

5000 training step

![5000 training steps](../dcgan_mnist/output/dcgan_steps_005000.png)

8000 training step

![8000 training steps](../dcgan_mnist/output/dcgan_steps_008000.png)

9380 training step

![9380 training step](../dcgan_mnist/output/dcgan_steps_009380.png)

## References

[Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks by Soumith Chintala et al.](https://arxiv.org/pdf/1511.06434v2.pdf)

[pytorch.org/tutorials/beginner/dcgan_faces_tutorial](https://pytorch.org/tutorials/beginner/dcgan_faces_tutorial.html)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto comment about reference format.

6 changes: 4 additions & 2 deletions vision/dcgan_mnist/dcgan_mnist.jl
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,7 @@ function train(; kws...)
save(@sprintf("output/dcgan_steps_%06d.png", train_steps), output_image)
end

cd(@__DIR__)
train()
if abspath(PROGRAM_FILE) == @__FILE__
train()
end

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions vision/mlp_mnist/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Multilayer Perceptron (MLP)

![mlp](../mlp_mnist/docs/mlp.svg)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar comments about image sourcing and reference formats for this file.


## Model Info

An MLP consists of at least three of nodes: an input layer, a hidden layer and an output layer. Except for the input node each node is a neuron that uses a nonlinear activation function. MLP utilizes a supervised learning technique called backpropagation for training. Its multiple layers and non-linear activation distinguish MLP from a linear perceptron. It can distinguish data that is not linearly separable.

## Training

```script
cd vision/mlp_mnist
julia --project mlp_mnist.jl
```

## Reference

[d2l.ai](http://d2l.ai/chapter_multilayer-perceptrons/mlp.html)
Loading