Skip to content

Instantly share code, notes, and snippets.

@ekinakyurek ekinakyurek/gan.ipynb
Last active Oct 15, 2018

Embed
What would you like to do?
GAN Notebook
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# GAN-70-Lines-of-Julia \n",
"This notebook is a demonstration for a simple GAN training on MNIST by using Julia. It will highlight how one can program a machine learning model in Julia as if just writing a paper. Let's get started!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Setup\n",
"We will use the deep learning package Knet.jl to compute gradients for the networks and use GPU arrays if a gpu device is available."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"┌ Warning: `Pkg.dir(pkgname, paths...)` is deprecated; instead, do `import Knet; joinpath(dirname(pathof(Knet)), \"..\", paths...)`.\n",
"└ @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:472\n"
]
},
{
"data": {
"text/plain": [
"KnetArray{Float32,N} where N"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"using Pkg; for p in (\"Knet\",\"Colors\",\"Images\",\"ImageMagick\"); haskey(Pkg.installed(),p) || Pkg.add(p); end #installs required packages\n",
"using Knet, Colors, Images, Statistics\n",
"include(Pkg.dir(\"Knet\",\"data\",\"mnist.jl\")) #MNIST data loader functions\n",
"global atype = gpu() >= 0 ? KnetArray{Float32} : Array{Float32}"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## MLP Model \n",
"Both for Generator and Discriminator, generic multilayer perceptrons are needed. $\\mathbf{w}$ is an array that keeps the model paramaters and $\\mathbf{x}$ is the input. Keyword argument $\\mathbf{p}$ is the dropout probability, `activation` is the activation function used in the hidden layers, and `outputactivation` is the activation function used in the output layer. We also define `elu` activation function."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"mlp (generic function with 1 method)"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"function mlp(w,x;p=0.0,activation=elu,outputactivation=sigm)\n",
" for i=1:2:length(w)\n",
" x = w[i]*dropout(mat(x),p) .+ w[i+1] # mat() used for flattening images to a vector.\n",
" i<length(w)-1 && (x = activation.(x)) \n",
" end\n",
" return outputactivation.(x) #output layer\n",
"end"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Discriminator and Generator Networks\n",
"\n",
"Discriminator and Generator networks are defined as `D` and `G` respectively. Loss functions `𝑱d` and `𝑱g` are defined according to the equation X in GAN paper. Sample noise function `𝒩` is a normal distribution. Loss functions are defined according to the equations in Algorithm 1 section of the [paper](https://arxiv.org/abs/1406.2661 \"arXiv\"). We use a slightly modified generator loss according to [GAN tricks](https://github.com/soumith/ganhacks#2-a-modified-loss-function \"GAN Tricks\").\n",
"$$ J_d = -\\frac{1}{m} \\sum_{i=1}^{m} log(D(x^{(i)}) + log(1-D(G(z^{(i)})))$$\n",
"$$ J_g = -\\frac{1}{m} \\sum_{i=1}^{m} log(D(G(z^{(i)}))) $$ \n",
"\n",
"*`𝜀` is used to prevent log functions from resulting NaN values.\n"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"𝒩 (generic function with 1 method)"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"global const 𝜀=Float32(1e-8)\n",
"D(w,x;p=0.0) = mlp(w,x;p=p)\n",
"G(w,z;p=0.0) = mlp(w,z;p=p) \n",
"𝑱d(𝗪d,x,Gz) = -mean(log.(D(𝗪d,x) .+ 𝜀)+log.((1+𝜀) .- D(𝗪d,Gz)))/2 \n",
"𝑱g(𝗪g, 𝗪d, z) = -mean(log.(D(𝗪d,G(𝗪g,z)) .+ 𝜀)) \n",
"𝒩(input, batch) = atype(randn(Float32, input, batch)) #SampleNoise"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Gradient Functions\n",
"\n",
"For backpropogation, we need the derivatives of loss functions according to the model parameters. This is where Knet comes to the scene. The `Knet.grad` function calculates gradient according to the first parameter of any function. So,"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(::getfield(AutoGrad, Symbol(\"#gradfun#8\")){getfield(AutoGrad, Symbol(\"##gradfun#6#7\")){typeof(𝑱g),Int64,Bool}}) (generic function with 1 method)"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"∇d = grad(𝑱d) # Discriminator gradient\n",
"∇g = grad(𝑱g) # Generator gradient"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Parameter Initialization\n",
"It is a generic weight initialization function for MLPs. For each layer, it creates a weight matrix and bias vector, then add them to $W$. "
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"initweights (generic function with 1 method)"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"function initweights(hidden,input, output)\n",
" 𝗪 = Any[];\n",
" x = input\n",
" for h in [hidden... output]\n",
" push!(𝗪, atype(xavier(h,x)), atype(zeros(h, 1))) #FC Layers weights and bias\n",
" x = h\n",
" end\n",
" return 𝗪 #return model params\n",
"end"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Generate and Display\n",
"\n",
"This function generates a random `number` of images and displays them."
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"generate_and_show (generic function with 1 method)"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"function generate_and_show(𝗪,number,𝞗)\n",
" Gz = Array(G(𝗪[1], 𝒩(𝞗[:ginp], number))) .> 0.5\n",
" Gz = reshape(Gz, (28, 28, number))\n",
" L = floor(Int, sqrt(number))\n",
" grid = []\n",
" for i = 1:L:number\n",
" push!(grid, reshape(permutedims(Gz[:,:,i:i+L-1], (2,3,1)), (L*28,28)))\n",
" end\n",
" display(Gray.(hcat(grid...)))\n",
"end"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Train & Test Function\n",
"\n",
"This `runmodel` function is implementing training procedure described in GAN paper. It first update discriminator with specified optimizer, then update generator network. Same function can be used in test mode by passing `train` argument as false. In the test mode it calculates losses instead of gradients."
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"runmodel (generic function with 1 method)"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"function runmodel(𝗪, data, 𝞗; dtst=nothing, optim=nothing, train=false, saveinterval=20)\n",
" gloss = dloss = total=0.0;\n",
" B = 𝞗[:batchsize]\n",
" for i=1:(train ? 𝞗[:epochs] : 1)\n",
" for (x,_) in data\n",
" total+=2B\n",
" Gz = G(𝗪[1], 𝒩(𝞗[:ginp], B)) #Generate Fake Images\n",
" train ? update!(𝗪[2], ∇d(𝗪[2],x,Gz), optim[2]) : (dloss += 2B*𝑱d(𝗪[2], x, Gz))\n",
" \n",
" z=𝒩(𝞗[:ginp],2B) #Sample z from Noise\n",
" train ? update!(𝗪[1], ∇g(𝗪[1], 𝗪[2], z), optim[1]) : (gloss += 2B*𝑱g(𝗪[1],𝗪[2],z)) \n",
" end\n",
" train ? runmodel(𝗪, dtst, 𝞗; train=false) : println((gloss/total, dloss/total))\n",
" i % saveinterval == 0 && generate_and_show(𝗪, 100, 𝞗) # save 10 images\n",
" end\n",
"end"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Run\n",
"We will train our model 80 epochs and display resulted images in each 20 epoch. The log format here is (generator loss, discriminator loss)."
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAARgAAAEYAQAAAACv9dQhAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAd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EVj1Cpwft524PSJNG6WnDEAguvPy5puafvTMu0RDpg/k3WzMvk4FBt9j46+ZS6roxZQzXKCL5bMFQnLp0WaNe9zcZdu/10jTiuXPJdrJqVkqVxinyNjNAWB5G9tpUSUOkC+GD9p5IkQgmALP/Cv7R8LYa3yqzXuOkcnOjmoMhHSGJEYyCoGFYbSd/YxXMa4Lg27SJ7ftd19oy0CqPaoLoHuEClmiJxO1M0FcvdweVecMwEko3YiFulNARXPtNFD8saoDWyhI8MYRDRuJ25lNt9GDRhFB4wYEKpmAp5tzzRDBjbzo7b/ADF72Qwso2nRd4ZLf+vXv7+bsTDCS9gvy6x5O3pThDSumst1gZGq3+M9nVbxOLbf5/zoviHprt76gThsXd2tgT0rKmkEU0k6QCpjqEojmNf/vCMls5NeIoMJlT/Kl98ZIBceLvScN3iwPjQEehxn+eFeccKQQ3DSlp32oS5UPEmKbCW9upfymjBqk31zRof+B8nSO3FboDT/AAAAAElFTkSuQmCC",
"text/plain": [
"280×280 Array{Gray{Bool},2} with eltype Gray{Bool}:\n",
" Gray{Bool}(true) Gray{Bool}(true) … Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(true) Gray{Bool}(false) Gray{Bool}(true) \n",
" Gray{Bool}(false) Gray{Bool}(true) Gray{Bool}(true) \n",
" Gray{Bool}(true) Gray{Bool}(false) Gray{Bool}(true) \n",
" Gray{Bool}(false) Gray{Bool}(true) … Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(true) \n",
" Gray{Bool}(true) Gray{Bool}(true) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(true) Gray{Bool}(false)\n",
" Gray{Bool}(true) Gray{Bool}(true) Gray{Bool}(true) \n",
" Gray{Bool}(false) Gray{Bool}(false) … Gray{Bool}(true) \n",
" Gray{Bool}(true) Gray{Bool}(false) Gray{Bool}(true) \n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(true) \n",
" ⋮ ⋱ \n",
" Gray{Bool}(true) Gray{Bool}(true) Gray{Bool}(false)\n",
" Gray{Bool}(true) Gray{Bool}(true) Gray{Bool}(true) \n",
" Gray{Bool}(false) Gray{Bool}(false) … Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(true) Gray{Bool}(false)\n",
" Gray{Bool}(true) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(true) Gray{Bool}(false) Gray{Bool}(true) \n",
" Gray{Bool}(false) Gray{Bool}(true) Gray{Bool}(false)\n",
" Gray{Bool}(true) Gray{Bool}(true) … Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(true) Gray{Bool}(true) \n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(true) Gray{Bool}(false) Gray{Bool}(false)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"(0.7070182002125642, 0.7129692123868526)\n",
"(2.6972159368869586, 0.14585052000788543)\n",
"(3.1427391599386167, 0.3839751585888175)\n",
"(3.0018755396207175, 0.28540667600165576)\n",
"(2.4193741717399697, 0.25220070901111913)\n",
"(2.714185036145724, 0.2753392961115027)\n",
"(2.3356421414094095, 0.2947772457622565)\n",
"(2.6071833769480386, 0.3119419638115244)\n",
"(2.715550125409395, 0.2807362637697504)\n",
"(2.638071894645691, 0.26305022360518193)\n",
"(3.221586035612302, 0.26055200561546743)\n",
"(3.16395251873212, 0.25307850958779454)\n",
"(3.4526335451847467, 0.1659754699525925)\n",
"(3.8970454449837026, 0.2135153397296866)\n",
"(4.0360427514100685, 0.23753360617690936)\n",
"(4.6163972937143765, 0.28057341661769897)\n",
"(4.7365608276465, 0.25558939514060813)\n",
"(4.162439642808376, 0.2463607530002124)\n",
"(3.903249970613382, 0.22100572519672987)\n",
"(4.283539904997899, 0.32198881942372864)\n",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wq04fZzpT0oZrq1I80UuT/yXUimByPGy/aaCtfOr9MP7eCRbKNVr9OMGI8Hzcz1YjUOhLBNRMxvG/hO6Fm9tpta1mfbOvPrP01OxYPZluiT/zfZv/rATPOS52VkAAAAASUVORK5CYII=",
"text/plain": [
"280×280 Array{Gray{Bool},2} with eltype Gray{Bool}:\n",
" Gray{Bool}(false) Gray{Bool}(false) … Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) … Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) … Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" ⋮ ⋱ \n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) … Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) … Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"3.9252934891443987, 0.30728288162022066)\n",
"(3.5431383015253606, 0.2915211880507951)\n",
"(3.666312500452384, 0.3384227947785686)\n",
"(3.20049225901946, 0.3302836251946596)\n",
"(3.059357313773571, 0.3308002264597095)\n",
"(2.7812724174597325, 0.3287823430907268)\n",
"(2.928862684048139, 0.34677521089235175)\n",
"(2.652854778827765, 0.33236346766352654)\n",
"(2.6760752544953275, 0.3308630677847526)\n",
"(2.754337956508001, 0.33148658285156274)\n",
"(2.594142747231019, 0.3392050064718112)\n",
"(2.455210806467594, 0.3372390930278179)\n",
"(2.818018090266448, 0.3410037870829304)\n",
"(2.674627593694589, 0.3494075063424997)\n",
"(2.634667009115219, 0.34120393527719456)\n",
"(2.7111851550065555, 0.3536763884461461)\n",
"(2.772063583899767, 0.360814557912258)\n",
"(2.90674651051179, 0.3763349872703354)\n",
"(2.6136230597129235, 0.34049034536553496)\n",
"(2.78036498488524, 0.34493475545866364)\n",
"("
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAARgAAAEYAQAAAACv9dQhAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QAAd2KE6QAAA5mSURBVGje5VpPrFxVGf/uu/PmDnScGTXBaZjOjCERd1wlpgN9vDeuWMLSBYEREl1ysYkMob53sY1lQZruZIHQpcsmbmokcBEiGhOKOxbEXoKKGiO3kdABp2/8/X7fmXmvbYJlYZR609d7557ffOc73/n+nzH7716Hik8YTHywc+3IUP+38Nd2zFZuNrLkWbPop5ac45crs8oxA//SEbO1mdWBiSvb2eXAzOxVsy5obOM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TQc61swH3MyGGY2npnfSe5hqHHZ72LDk9USsMGJJLhFmewDCAIv9NqrEOqIH5Ru6YDY2Pl5jpMgS3f56rx9j3xKDm+YMCMUIeJoDWtJGAt50GNbTmIYqB+EIpTGOCIJlrhg9cQ1/T74iEQY3OnzAhFqaxS3Tuv+L5gy0THq7mjkNup5EtE3nz1h6vgOmD03DMt4dZrp2bjYE+fPgXS+t4m0PVRrE6iDvmmC53srA0VH3Z/iMB1Rfq4smO0qZMnnZ6e8AMPc9gXnI45y1NXYVSL/BqjqF86Rcvi3q/8n3IHDP0H2MUjmEUCeYfueZt2PL3YOIstBvNv9LZ+/WNs5Qs17939fcey09lNtdx/QvRLrltWqjzewAAAABJRU5ErkJggg==",
"text/plain": [
"280×280 Array{Gray{Bool},2} with eltype Gray{Bool}:\n",
" Gray{Bool}(false) Gray{Bool}(false) … Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) … Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) … Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" ⋮ ⋱ \n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) … Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) … Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"2.5133315049684963, 0.33060858864337206)\n",
"(2.8660962528143172, 0.3613075128971384)\n",
"(2.6848798462977777, 0.3406564880353518)\n",
"(2.6033156445393195, 0.33214112032109344)\n",
"(2.7740061657551007, 0.3419588938212165)\n",
"(2.6678343010254397, 0.3305944459369549)\n",
"(2.8780798415342965, 0.33968478178557676)\n",
"(2.811693642383967, 0.33556619439369595)\n",
"(2.8969312050403695, 0.3468700819768203)\n",
"(2.771579799743799, 0.34334640627583635)\n",
"(2.564284560007927, 0.34032854738716894)\n",
"(2.731122597669944, 0.3277671412111093)\n",
"(2.853467990190555, 0.330749364116062)\n",
"(2.7829492466572003, 0.3274786518409084)\n",
"(2.971490354110033, 0.33781160438098967)\n",
"(3.0116113126277924, 0.3454614580871585)\n",
"(3.184412360191345, 0.3593942236680633)\n",
"(2.7643437492541776, 0.3205802728398106)\n",
"(2.9332831425544543, 0.3383164644145813)\n",
"(2.9161910521678434, 0.33831781944116723)\n",
"("
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAARgAAAEYAQAAAACv9dQhAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAA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j9pm6I7VZMjgCDCbbq1Q3iFj6bihuoZ6iqweLQO/UWn8SJkZ6DCHxCBB6SC1hFTVg7CIwY20CMX72QM9KbVERBJhLqunRoCJIj91p8/v9ZUgFU5cBmETMRFAMxHdQ8JL306XsPejS9rSHGHQiTGkzWgnKyGtxnV0VNrj2RH/qYK0xwyzJkIKphzDSf02dHuiHAY+uyu1ToR+Ry5jrifO9HD8L5c/1NfZi4U151cbrx9RvDMSSfjhW0xWOf2nOs9BC1Z7TRdXIgKaM6qGLpTaA+tXz3BNBZuvPZi/kXqib2RNnKg7AkN1G73p1YGG9l/S3NPxiNLTsWMXu4iPAPLoQBikiD5/NMcOOpdx0zPVJ9Fxk8kv5hrsqmI+DJnPEIBy0PlIIE1Wqdun4Nvcqsh/4DvDi9AlhYjDzJ7kHLGDb3KWB60CppINH0jEP3d3FhJPgRCG7EgoG1X+UkicvVIqxR2EcDwW6qcfNfiaX3DW31kWlB8SEo2bG85ThXUYlb+qs0cuFux7W3+1fiPMFF72hY6hc0p+pos8lttzgCFNHTwGTCnZfYTmPy9wn23bJflZjOSY6X0RFzYuyZ72fWtead8+sEwoOwJzLoxJfsKivQ1wJprWsgHFrIyJE85afmb7j/cBV8xClt1xVSTHRaNF1zJveD4PLiZfpW7Yqn7Y8m1eMRImUa8oObf3rlb16c/hbknC17cMn0v+562/SSEJhas3vNQAAAABJRU5ErkJggg==",
"text/plain": [
"280×280 Array{Gray{Bool},2} with eltype Gray{Bool}:\n",
" Gray{Bool}(false) Gray{Bool}(false) … Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) … Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) … Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" ⋮ ⋱ \n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) … Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) … Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)\n",
" Gray{Bool}(false) Gray{Bool}(false) Gray{Bool}(false)"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"𝞗=Dict(:batchsize=>32,:epochs=>80,:ginp=>256,:genh=>[512],:disch=>[512],:optim=>Adam,:lr=>0.0002);\n",
"xtrn,ytrn,xtst,ytst = mnist()\n",
"global dtrn = minibatch(xtrn, ytrn, 𝞗[:batchsize]; xtype=atype)\n",
"global dtst = minibatch(xtst, ytst, 𝞗[:batchsize]; xtype=atype)\n",
"𝗪 = (𝗪g,𝗪d) = initweights(𝞗[:genh], 𝞗[:ginp], 784), initweights(𝞗[:disch], 784, 1)\n",
"𝚶 = (𝚶pg,𝚶pd) = optimizers(𝗪g, 𝞗[:optim]; lr=𝞗[:lr]), optimizers(𝗪d,𝞗[:optim]; lr=𝞗[:lr])\n",
"generate_and_show(𝗪,100,𝞗)\n",
"runmodel(𝗪, dtst, 𝞗; optim=𝚶, train=false) # initial losses\n",
"runmodel(𝗪, dtrn, 𝞗; optim=𝚶, train=true, dtst=dtst) # training "
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.0.1",
"language": "julia",
"name": "julia-1.0"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.0.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.