Updating GAN Code...

This commit is contained in:
Shubbair 2024-07-28 17:56:26 +03:00
parent d17d293df9
commit c0c8293842

View File

@ -388,16 +388,16 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 40, "execution_count": 43,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"data": { "data": {
"text/plain": [ "text/plain": [
"array(0.662747, dtype=float32)" "array(0.675341, dtype=float32)"
] ]
}, },
"execution_count": 40, "execution_count": 43,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
@ -418,7 +418,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 41, "execution_count": 44,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -427,7 +427,7 @@
"60000" "60000"
] ]
}, },
"execution_count": 41, "execution_count": 44,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
@ -438,7 +438,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 42, "execution_count": 45,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -452,7 +452,7 @@
"source": [ "source": [
"# Train the GAN for only 1000 images\n", "# Train the GAN for only 1000 images\n",
"batch_size = 16\n", "batch_size = 16\n",
"display_step = 50\n", "display_step = 20\n",
"cur_step = 0\n", "cur_step = 0\n",
"mean_generator_loss = 0\n", "mean_generator_loss = 0\n",
"mean_discriminator_loss = 0\n", "mean_discriminator_loss = 0\n",
@ -463,7 +463,7 @@
"\n", "\n",
"for epoch in tqdm(range(200)):\n", "for epoch in tqdm(range(200)):\n",
"\n", "\n",
" for real in batch_iterate(batch_size, train_images[:1000]):\n", " for real in batch_iterate(batch_size, train_images[:500]):\n",
" \n", " \n",
" D_loss,D_grads = D_loss_grad(gen, disc, real, batch_size, z_dim)\n", " D_loss,D_grads = D_loss_grad(gen, disc, real, batch_size, z_dim)\n",
"\n", "\n",