Created
August 14, 2018 17:33
-
-
Save George3d6/6b58aa69ec1e56e29e2337848116696b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function log_model(πͺ, data, π, generation) | |
println("Running logging function for generation $(generation)") | |
println("-----------------------------------------------------") | |
gloss=dloss=counter=0.0 | |
for n=1:32:(length(data[1,1,1,:]) - 33) | |
x = data[:,:,:,n:n+31] | |
counter+=2*π[:batchsize] | |
Gz = G(πͺ[1],π©(π[:ginp],π[:batchsize])) | |
dloss += 2π[:batchsize]*π±d(πͺ[2],x,Gz) | |
z=π©(π[:ginp],2*π[:batchsize]) | |
gloss += 2π[:batchsize]*π±g(πͺ[1],πͺ[2],z) | |
end | |
println("Generator average loss: $(gloss/counter)") | |
println("discriminator average loss: $(dloss/counter)") | |
generate_and_save(πͺ,6,π,generation) | |
println("Saved images for generation: $(generation)") | |
println("------------------------------------------------\n") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment