examples/dcgan/imgen.rb in ruby-dnn-0.14.3 vs examples/dcgan/imgen.rb in ruby-dnn-0.15.0

- old
+ new

@@ -6,16 +6,11 @@ include DNN::Loaders Image = DNN::Image batch_size = 100 -gen = Generator.new -dis = Discriminator.new -dcgan = DCGAN.new(gen, dis) -dcgan.predict1(Numo::SFloat.zeros(20)) - -loader = MarshalLoader.new(dcgan) -loader.load("trained/dcgan_model_epoch20.marshal") +dcgan = DCGAN.load("trained/dcgan_model_epoch20.marshal") +gen = dcgan.gen Numo::SFloat.srand(rand(1 << 31)) noise = Numo::SFloat.new(batch_size, 20).rand(-1, 1) images = gen.predict(noise)