2024-07-26 21:07:40 +08:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Import Library"
]
},
{
"cell_type": "code",
2024-07-27 05:19:08 +08:00
"execution_count": 113,
2024-07-26 21:07:40 +08:00
"metadata": {},
"outputs": [],
"source": [
"import mnist"
]
},
{
"cell_type": "code",
2024-07-27 05:19:08 +08:00
"execution_count": 114,
2024-07-26 21:07:40 +08:00
"metadata": {},
"outputs": [],
"source": [
"import mlx.core as mx\n",
"import mlx.nn as nn\n",
"import mlx.optimizers as optim\n",
"\n",
"from tqdm import tqdm\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# GAN Architecture"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Generator 👨🏻🎨"
]
},
{
"cell_type": "code",
2024-07-27 05:19:08 +08:00
"execution_count": 115,
2024-07-26 21:07:40 +08:00
"metadata": {},
"outputs": [],
"source": [
"def GenBlock(in_dim:int,out_dim:int):\n",
" \n",
" return nn.Sequential(\n",
" nn.Linear(in_dim,out_dim),\n",
" nn.BatchNorm(out_dim),\n",
" nn.ReLU()\n",
" )"
]
},
{
"cell_type": "code",
2024-07-27 05:19:08 +08:00
"execution_count": 116,
2024-07-26 21:07:40 +08:00
"metadata": {},
"outputs": [],
"source": [
"class Generator(nn.Module):\n",
"\n",
" def __init__(self, z_dim:int = 10, im_dim:int = 784, hidden_dim: int =128):\n",
" super(Generator, self).__init__()\n",
" # Build the neural network\n",
" self.gen = nn.Sequential(\n",
" GenBlock(z_dim, hidden_dim),\n",
" GenBlock(hidden_dim, hidden_dim * 2),\n",
" GenBlock(hidden_dim * 2, hidden_dim * 4),\n",
" GenBlock(hidden_dim * 4, hidden_dim * 8),\n",
"\n",
"\n",
" nn.Linear(hidden_dim * 8,im_dim),\n",
" nn.Sigmoid()\n",
" )\n",
" \n",
" def __call__(self, noise):\n",
"\n",
" return self.gen(noise)"
]
},
{
"cell_type": "code",
2024-07-27 05:19:08 +08:00
"execution_count": 117,
2024-07-26 21:07:40 +08:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Generator(\n",
" (gen): Sequential(\n",
" (layers.0): Sequential(\n",
" (layers.0): Linear(input_dims=100, output_dims=128, bias=True)\n",
" (layers.1): BatchNorm(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
" (layers.2): ReLU()\n",
" )\n",
" (layers.1): Sequential(\n",
" (layers.0): Linear(input_dims=128, output_dims=256, bias=True)\n",
" (layers.1): BatchNorm(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
" (layers.2): ReLU()\n",
" )\n",
" (layers.2): Sequential(\n",
" (layers.0): Linear(input_dims=256, output_dims=512, bias=True)\n",
" (layers.1): BatchNorm(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
" (layers.2): ReLU()\n",
" )\n",
" (layers.3): Sequential(\n",
" (layers.0): Linear(input_dims=512, output_dims=1024, bias=True)\n",
" (layers.1): BatchNorm(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n",
" (layers.2): ReLU()\n",
" )\n",
" (layers.4): Linear(input_dims=1024, output_dims=784, bias=True)\n",
" (layers.5): Sigmoid()\n",
" )\n",
")"
]
},
2024-07-27 05:19:08 +08:00
"execution_count": 117,
2024-07-26 21:07:40 +08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gen = Generator(100)\n",
"gen"
]
},
{
"cell_type": "code",
2024-07-27 05:19:08 +08:00
"execution_count": 118,
2024-07-26 21:07:40 +08:00
"metadata": {},
"outputs": [],
"source": [
"def get_noise(n_samples, z_dim):\n",
" return np.random.randn(n_samples,z_dim)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Discriminator 🕵🏻♂️"
]
},
{
"cell_type": "code",
2024-07-27 05:19:08 +08:00
"execution_count": 119,
2024-07-26 21:07:40 +08:00
"metadata": {},
"outputs": [],
"source": [
"def DisBlock(in_dim:int,out_dim:int):\n",
" return nn.Sequential(\n",
" nn.Linear(in_dim,out_dim),\n",
" nn.LeakyReLU(negative_slope=0.2)\n",
" )"
]
},
{
"cell_type": "code",
2024-07-27 05:19:08 +08:00
"execution_count": 120,
2024-07-26 21:07:40 +08:00
"metadata": {},
"outputs": [],
"source": [
"class Discriminator(nn.Module):\n",
"\n",
" def __init__(self,im_dim:int = 784, hidden_dim:int = 128):\n",
" super(Discriminator, self).__init__()\n",
"\n",
" self.disc = nn.Sequential(\n",
" DisBlock(im_dim, hidden_dim * 4),\n",
" DisBlock(hidden_dim * 4, hidden_dim * 2),\n",
" DisBlock(hidden_dim * 2, hidden_dim),\n",
"\n",
" nn.Linear(hidden_dim,1),\n",
" )\n",
" \n",
" def __call__(self, noise):\n",
"\n",
" return self.disc(noise)"
]
},
{
"cell_type": "code",
2024-07-27 05:19:08 +08:00
"execution_count": 121,
2024-07-26 21:07:40 +08:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Discriminator(\n",
" (disc): Sequential(\n",
" (layers.0): Sequential(\n",
" (layers.0): Linear(input_dims=784, output_dims=512, bias=True)\n",
" (layers.1): LeakyReLU()\n",
" )\n",
" (layers.1): Sequential(\n",
" (layers.0): Linear(input_dims=512, output_dims=256, bias=True)\n",
" (layers.1): LeakyReLU()\n",
" )\n",
" (layers.2): Sequential(\n",
" (layers.0): Linear(input_dims=256, output_dims=128, bias=True)\n",
" (layers.1): LeakyReLU()\n",
" )\n",
" (layers.3): Linear(input_dims=128, output_dims=1, bias=True)\n",
" )\n",
")"
]
},
2024-07-27 05:19:08 +08:00
"execution_count": 121,
2024-07-26 21:07:40 +08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"disc = Discriminator()\n",
"disc"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Model Training 🏋🏻♂️"
]
},
{
"cell_type": "code",
2024-07-27 05:19:08 +08:00
"execution_count": 122,
2024-07-26 21:07:40 +08:00
"metadata": {},
"outputs": [],
"source": [
"# Set your parameters\n",
"criterion = nn.losses.binary_cross_entropy\n",
"n_epochs = 200\n",
"z_dim = 64\n",
"display_step = 500\n",
"batch_size = 128\n",
"lr = 0.00001"
]
},
{
"cell_type": "code",
2024-07-27 05:19:08 +08:00
"execution_count": 123,
2024-07-26 21:07:40 +08:00
"metadata": {},
2024-07-27 05:22:29 +08:00
"outputs": [
{
"ename": "KeyboardInterrupt",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[123], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m gen \u001b[38;5;241m=\u001b[39m Generator(z_dim)\n\u001b[0;32m----> 2\u001b[0m \u001b[43mmx\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43meval\u001b[49m\u001b[43m(\u001b[49m\u001b[43mgen\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mparameters\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 3\u001b[0m gen_opt \u001b[38;5;241m=\u001b[39m optim\u001b[38;5;241m.\u001b[39mAdam(learning_rate\u001b[38;5;241m=\u001b[39mlr)\n\u001b[1;32m 5\u001b[0m disc \u001b[38;5;241m=\u001b[39m Discriminator()\n",
"\u001b[0;31mKeyboardInterrupt\u001b[0m: "
]
}
],
2024-07-26 21:07:40 +08:00
"source": [
"gen = Generator(z_dim)\n",
2024-07-26 21:36:29 +08:00
"mx.eval(gen.parameters())\n",
2024-07-26 21:07:40 +08:00
"gen_opt = optim.Adam(learning_rate=lr)\n",
2024-07-26 21:36:29 +08:00
"\n",
2024-07-26 21:07:40 +08:00
"disc = Discriminator()\n",
2024-07-26 21:36:29 +08:00
"mx.eval(disc.parameters())\n",
2024-07-26 21:07:40 +08:00
"disc_opt = optim.Adam(learning_rate=lr)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Losses"
]
},
{
"cell_type": "code",
2024-07-27 05:19:08 +08:00
"execution_count": null,
2024-07-26 21:07:40 +08:00
"metadata": {},
"outputs": [],
"source": [
2024-07-26 21:36:29 +08:00
"def disc_loss(gen, disc, real, num_images, z_dim):\n",
2024-07-26 21:07:40 +08:00
" noise = mx.array(get_noise(num_images, z_dim))\n",
" fake_images = gen(noise)\n",
" \n",
" fake_disc = disc(fake_images)\n",
" \n",
2024-07-27 05:19:08 +08:00
" fake_labels = mx.zeros((fake_images.shape[0],1))\n",
2024-07-26 21:36:29 +08:00
" fake_loss = nn.losses.binary_cross_entropy(fake_disc,fake_labels,with_logits=True)\n",
2024-07-26 21:07:40 +08:00
" \n",
" real_disc = disc(real)\n",
2024-07-27 05:19:08 +08:00
" real_labels = mx.ones((real.shape[0],1))\n",
"\n",
" # print('Shapes.....',real_disc.shape,real_labels.shape)\n",
" real_loss = nn.losses.binary_cross_entropy(real_disc,real_labels)\n",
2024-07-26 21:07:40 +08:00
"\n",
" disc_loss = (fake_loss + real_loss) / 2\n",
"\n",
" return disc_loss"
]
},
{
"cell_type": "code",
2024-07-27 05:19:08 +08:00
"execution_count": null,
2024-07-26 21:07:40 +08:00
"metadata": {},
"outputs": [],
"source": [
2024-07-26 21:36:29 +08:00
"def gen_loss(gen, disc, num_images, z_dim):\n",
2024-07-26 21:07:40 +08:00
"\n",
" noise = mx.array(get_noise(num_images, z_dim))\n",
" fake_images = gen(noise)\n",
" \n",
" fake_disc = disc(fake_images)\n",
"\n",
2024-07-27 05:19:08 +08:00
" fake_labels = mx.ones((fake_images.shape[0],1))\n",
2024-07-26 21:07:40 +08:00
" \n",
2024-07-26 21:36:29 +08:00
" gen_loss = nn.losses.binary_cross_entropy(fake_disc,fake_labels,with_logits=True)\n",
2024-07-26 21:07:40 +08:00
"\n",
" return gen_loss"
]
},
{
"cell_type": "code",
2024-07-27 05:19:08 +08:00
"execution_count": 105,
2024-07-26 21:07:40 +08:00
"metadata": {},
"outputs": [],
"source": [
"train_images, _, test_images, _ = map(\n",
" mx.array, getattr(mnist, 'mnist')()\n",
")"
]
},
{
"cell_type": "code",
2024-07-27 05:19:08 +08:00
"execution_count": 106,
2024-07-26 21:07:40 +08:00
"metadata": {},
"outputs": [],
"source": [
"def batch_iterate(batch_size:int, ipt:list):\n",
" perm = mx.array(np.random.permutation(len(ipt)))\n",
" for s in range(0, ipt.size, batch_size):\n",
" ids = perm[s : s + batch_size]\n",
" yield ipt[ids]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### show batch of images"
]
},
{
"cell_type": "code",
2024-07-27 05:19:08 +08:00
"execution_count": null,
2024-07-26 21:07:40 +08:00
"metadata": {},
"outputs": [
{
"data": {
2024-07-27 05:19:08 +08:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAUkAAAFICAYAAADd1gwNAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAACOnElEQVR4nOy955Oc13mnfXXOOU9PDhgMciAJUoREUpJTydm7DuvdcnnT37Nftmr3w1atN7jsWsuWX2stiUtJpCkQJAEBRMbk1NPTOef4foDPQQ8wGABEmO6Z56qaIoieafTzzHnuc587/G5Vt9vtoqCgoKCwK+r9/gAKCgoK/YxiJBUUFBT2QDGSCgoKCnugGEkFBQWFPVCMpIKCgsIeKEZSQUFBYQ8UI6mgoKCwB4qRVFBQUNgDxUgqKCgo7IH2Wb9RpVK9ys8xUHzdJiXlHj5EuYcvjnIPX5xnuYeKJ6mgoKCwB4qRVFBQUNgDxUgqKCgo7IFiJBUUFBT2QDGSCgoKCnugGEkFBQWFPVCMpIKCgsIeKEZSQUFBYQ8UI6mgoKCwB4qRVFBQUNiDZ25LfB2o1Wo8Hg92ux2DwYDZbKbT6ZDJZKjX6xSLRUql0n5/TIUDilqtRq/Xo9FosNlsmM1mGo0G1WqVdrtNqVSi1Wrt+rN6vR6tVovL5SIYDKJSqWg2m7TbbeLxOMlk8jVfzeAj7qder3/sNY1Gg9PpxGQyPfZat9slkUiQyWRoNpvUarWv3cIJfWYk9Xo93/rWtzh37hzDw8McP36ccrnMT3/6UzY3N7l+/To3btx4oQtWUHgSBoOBQCCAxWLh/PnzTE1NkUwmWVtbI5fLcefOHbLZ7GM/p9Fo8Hq92O12PvjgA/71v/7XaLVaEokElUqFv/qrv+IHP/iBsm6fE5vNxsWLFwkGg4+9Zjab+eY3v8nU1NRjrzWbTb7//e/zk5/8hFwux/r6Os1m82t/jr4ykmq1GpfLxfDwMJOTkxw/fpxSqcTy8jKdTofl5eX9/ogDgUqlkl+P/l2326Xb7aJSqVCrH0RbOp3OjgdYpVKh0Wjk94jvEwgPqdPp0Ol0Xs9FvWJUKhVarRa73Y7dbmdoaIixsTG0Wi25XI52u41W++THRa/XYzabCQQCHDt2DK1Wi8PhIJ/P43Q6X9+FvAZ615dard6xzrrd7mNronetPYparX7ifXU4HAwNDREOhx97zWKxMDs7y9GjRx97rdFocPnyZWw2G7Va7YUFPfrKSPY+qOLPRqOR8+fPMzExQSQS4Re/+IWyI++BCFnYbDa5ALVaLVarFb1eT6VSoVKpYDabCQaDqNVqEokEuVxOvofFYmFmZgaHw0EoFCIQCMiFVq1WuXTpEisrKySTSba2tgbeUOr1egwGAxMTE/z+7/8+wWCQ8fFxfD4fKpWKhYWFPX9epVJhNptxOBxYLBY0Gg3tdptYLPbYvT0IWK1W/H4/RqMRv9+PxWKRr1WrVeLxOI1GQ/6d3W7H5/Oh0Wgeey+v18upU6cwm82PvWYymRgbG8NqtT72mk6nIxAIvKQr2pu+MpKA9HTEn41GI0eOHKHRaPDhhx8qMk9PQaVSyUWp1WoxmUzo9Xq8Xi9Go5FcLkc2m8XlcnH06FG0Wi0LCwvE43H5Hk6nk3fffZdQKMTx48c5cuSIvO/5fJ5Op4NKpaLT6RCNRvfrUl8aOp0Ok8lEIBDg4sWLjI2NYbFYMBgMxOPxJ3pBApVKhdFoxGazYTQa0Wg0NJtNMpkMsViMcrn8mq7k9WAymQgGg9hsNmZnZ3G5XPK1fD7P/fv3qVar8u8CgQAzMzO7eowTExP81m/91o736Df6zkg+Su+Rz2w243K5qNVqVCqVgfdgXgYulwu3243RaMTlcmE0GpmYmMDv90svUqfTYbfb0el0lMtlyuUyFouFoaEhGQAvFAryPYUn6XQ6sVqtOzYmrVbLkSNH5P8vLy9Tq9VotVoD6+EPDw9z9OhRZmZm8Hg8GI1G1tfXSaVS3L59m7W1NbLZLPV6fdefV6vVOBwOgsEgdrtdJm22trZYXV09cJ6k3+/n4sWLOJ1OQqHQDk+vUqkQCAR2eJLi3uzmSfp8PnQ63Uv9fN1ul1KpRCKRoFAovLCd6HsjCQ8C4zqdDqfTyfDwMIVCgUgksuMXcRhRqVSMjo5y5swZfD4fp06dwul0MjExQSAQkJtLb+xIxB9F3BHYEVsUsSatVotarX5sYZtMJr71rW/x9ttvo9Pp+PzzzykUCpTL5SdmfvsZtVrN6dOn+ZM/+RO8Xi8TExOoVCquXr3KJ598QiQS4fbt2zQajScG/zUaDeFwmKNHjxIKhVCr1VSrVe7evcvNmzeJRqMDu4HsxszMDP/xP/5HvF7vYzFrsZZ6r3e3dSTQaDS7Zq9fhG63SzKZZHFxkXa7TbvdfqH36zsj2W63ZWKgF3GkcTgctFqtpx6BDjJqtVrGGAOBAMPDw3g8HoLBIA6HA4/HI5MFe4UnxGuP/lfQG/bo/Rmz2YzRaMRkMu2a2BkUdDodWq0Wm82Gx+PBarVSqVRoNpuk02kSiQTZbFZ6yk9CpVLJI7ter5ebUaPReOrPDiJ6vV4muF4XrVaLVquFRqNBq9XuWKuVSoVisShtR7VaJZvN0mw2X8rm1FdGstvtksvliEajeDyeHYZSpVIxNDTEuXPnWFtbY3Nzk1qtto+fdv+wWq18+9vfZmxsjLNnz3L+/HlMJhM2m03GIdVqNa1Wi0aj8cTdXXiLOp3uiTv9bjzqnQ5inFin0zE0NITNZmN8fJyRkREKhQIfffQRqVSKS5cucefOHer1+lM9kd7EjclkGsj70c90u11SqRSJRAKbzcbw8PCOI/pXX33FD3/4QwqFApubmxSLRZaXl1+a9953RrJWq1EqlXaN/1gsFvx+P4VC4bke6oOGXq9nbGyMY8eOMTc3x9zcHGq1+jHPr91uU6/X6XQ6tFqtHbEZrVaLwWCQO/Oj9JYK9dLrdQ6yMVCr1dhsNtxuN06nE7vdTqFQYG1tja2tLba2tkin08/8fjqdDoPBsGeZ0EGiN2zzPOxluHarbhF/LpVKpNNpOp2ODCUJ4vE4169fJ5lMsrCwQLFYfK7P9DT66jfabreJRqOoVCr8fv9jnqQ4blssFulyH6RYz9MwGo3Y7XaCwSBTU1PMzs7KMpVOp0Oz2aTZbLK2tkYymSSZTLK6uiqPIL1GMhgM8s477+xIOAgajQbRaJRqtYrL5cLhcOx6zBlkLBYL3/zmNzl69CgnTpxAo9FQr9fZ3NxkY2PjpT9oB4lEIsEXX3xBMBiUCb5noVarsbCwQD6ff+w10VlXLpcplUpks9kdz38ulyOXy2EymfB6vTucpPv377O0tES1Wn1icu1F6DsjGYlEyGazHDly5LFjjtFoxOl0ymOlWq1+7Bh5kBGlF+FwmJmZGebm5jCbzahUKuk1VioVbt26xe3bt1leXubzzz+nWq1SKpV2JB5Onz6N0+lkdHT0sfhSvV5ndXWVbDbLxMQEer3+uY/k/Y7VauWDDz7gvffek9dWr9fZ2NhgeXl5R7ZfYSfJZJLPPvuMcDiM1+t9ZiNZqVS4ceMG6+vrj73WbDZZXFwkmUyyvb3NysrKjljuo3HxXnoTj6/CFvSVkYSHF7xb2t5iseDz+XA6neh0OnnEPCxGUqPRYDKZZOJE9AvDA8O2vb1NPp9nY2ODjY0N4vE45XKZer1Oo9Gg3W7viCXq9XrZq6xSqchms8RiMXK5HHfv3iWbzaLX63E6nZjNZkwmE51Oh2q1SrPZpFwuy86bQUHUM/p8PqxWKwaDgXK5TDKZJBaLUSwWqVarz5xsEfdTq9Xu+H0cZBqNBrlcDovF8kztfqVSSXqClUpl1xhvp9PBYDBgsVjQ6XQ0m82+SXgNzG9UpVIRDofx+Xw0Gg2sVis6nW7XNqiDiih49vv9OBwOrFarNHjZbJZ/+qd/IhqN8vOf/1yWrdRqtR2bjqibFF0TgUAAo9EIwO3bt/mrv/orUqkUd+7coVQq8bu/+7totVr5b2o0GiKRCKlUikgkQqVSkXHPQcDr9XL
2024-07-26 21:07:40 +08:00
"text/plain": [
"<Figure size 400x400 with 16 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"for X in batch_iterate(16, train_images):\n",
" fig,axes = plt.subplots(4, 4, figsize=(4, 4))\n",
"\n",
" for i, ax in enumerate(axes.flat):\n",
" img = mx.array(X[i]).reshape(28,28)\n",
" ax.imshow(img,cmap='gray')\n",
" ax.axis('off')\n",
" break"
]
},
{
"cell_type": "code",
2024-07-27 05:19:08 +08:00
"execution_count": null,
2024-07-26 21:07:40 +08:00
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
2024-07-27 05:19:08 +08:00
" 0%| | 139/60000 [00:00<01:22, 726.53it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 1%| | 307/60000 [00:00<01:14, 801.44it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 1%| | 471/60000 [00:00<01:13, 808.99it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 1%| | 633/60000 [00:00<01:14, 800.05it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 1%|▏ | 794/60000 [00:01<01:16, 778.34it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 2%|▏ | 949/60000 [00:01<01:18, 747.52it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 2%|▏ | 1098/60000 [00:01<01:20, 733.90it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 2%|▏ | 1240/60000 [00:01<01:28, 660.48it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 2%|▏ | 1307/60000 [00:01<01:29, 656.89it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 2%|▏ | 1438/60000 [00:02<01:36, 608.91it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 3%|▎ | 1561/60000 [00:02<01:36, 603.59it/s]"
2024-07-26 21:07:40 +08:00
]
},
{
2024-07-27 05:19:08 +08:00
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 3%|▎ | 1683/60000 [00:02<01:40, 582.79it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 3%|▎ | 1799/60000 [00:02<01:45, 552.37it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 3%|▎ | 1915/60000 [00:02<01:46, 543.12it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 3%|▎ | 2026/60000 [00:03<01:46, 543.94it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 4%|▎ | 2142/60000 [00:03<01:43, 560.25it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 4%|▍ | 2257/60000 [00:03<01:45, 545.45it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 4%|▍ | 2365/60000 [00:03<01:51, 518.84it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 4%|▍ | 2472/60000 [00:03<01:53, 506.74it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 4%|▍ | 2575/60000 [00:04<01:53, 504.04it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 4%|▍ | 2626/60000 [00:04<02:02, 469.09it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 5%|▍ | 2781/60000 [00:04<01:55, 494.90it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 5%|▍ | 2831/60000 [00:04<01:56, 490.73it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 5%|▍ | 2928/60000 [00:04<02:10, 438.99it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 5%|▌ | 3023/60000 [00:05<02:05, 453.50it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 5%|▌ | 3118/60000 [00:05<02:03, 460.44it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 5%|▌ | 3211/60000 [00:05<02:06, 449.22it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 6%|▌ | 3302/60000 [00:05<02:16, 416.36it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 6%|▌ | 3391/60000 [00:05<02:12, 426.27it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 6%|▌ | 3479/60000 [00:06<02:13, 423.14it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 6%|▌ | 3564/60000 [00:06<02:17, 411.69it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 6%|▌ | 3648/60000 [00:06<02:20, 401.16it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n",
"real shape , (784,)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 6%|▌ | 3662/60000 [00:54<14:01, 66.96it/s] \n"
]
},
{
"ename": "KeyboardInterrupt",
"evalue": "",
2024-07-26 21:07:40 +08:00
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
2024-07-27 05:19:08 +08:00
"\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[108], line 40\u001b[0m\n\u001b[1;32m 37\u001b[0m G_loss,G_grads \u001b[38;5;241m=\u001b[39m G_loss_grad(gen, disc, batch_size, z_dim)\n\u001b[1;32m 39\u001b[0m \u001b[38;5;66;03m# Update optimizer\u001b[39;00m\n\u001b[0;32m---> 40\u001b[0m \u001b[43mgen_opt\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mupdate\u001b[49m\u001b[43m(\u001b[49m\u001b[43mgen\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mG_grads\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 42\u001b[0m \u001b[38;5;66;03m# Update gradients\u001b[39;00m\n\u001b[1;32m 43\u001b[0m \n\u001b[1;32m 44\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 60\u001b[0m \u001b[38;5;66;03m# mean_discriminator_loss = 0\u001b[39;00m\n\u001b[1;32m 61\u001b[0m \u001b[38;5;66;03m# cur_step += 1\u001b[39;00m\n",
"File \u001b[0;32m~/miniforge3/lib/python3.10/site-packages/mlx/optimizers/optimizers.py:29\u001b[0m, in \u001b[0;36mOptimizer.update\u001b[0;34m(self, model, gradients)\u001b[0m\n\u001b[1;32m 20\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mupdate\u001b[39m(\u001b[38;5;28mself\u001b[39m, model: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmlx.nn.Module\u001b[39m\u001b[38;5;124m\"\u001b[39m, gradients: \u001b[38;5;28mdict\u001b[39m):\n\u001b[1;32m 21\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"Apply the gradients to the parameters of the model and update the\u001b[39;00m\n\u001b[1;32m 22\u001b[0m \u001b[38;5;124;03m model with the new parameters.\u001b[39;00m\n\u001b[1;32m 23\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 27\u001b[0m \u001b[38;5;124;03m via :func:`mlx.nn.value_and_grad`.\u001b[39;00m\n\u001b[1;32m 28\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m---> 29\u001b[0m model\u001b[38;5;241m.\u001b[39mupdate(\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mapply_gradients\u001b[49m\u001b[43m(\u001b[49m\u001b[43mgradients\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmodel\u001b[49m\u001b[43m)\u001b[49m)\n",
"File \u001b[0;32m~/miniforge3/lib/python3.10/site-packages/mlx/optimizers/optimizers.py:88\u001b[0m, in \u001b[0;36mOptimizer.apply_gradients\u001b[0;34m(self, gradients, parameters)\u001b[0m\n\u001b[1;32m 85\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstate[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mstep\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstep \u001b[38;5;241m+\u001b[39m \u001b[38;5;241m1\u001b[39m\n\u001b[1;32m 87\u001b[0m \u001b[38;5;66;03m# Apply the update\u001b[39;00m\n\u001b[0;32m---> 88\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mtree_map\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mapply_single\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mgradients\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mparameters\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstate\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/miniforge3/lib/python3.10/site-packages/mlx/utils.py:48\u001b[0m, in \u001b[0;36mtree_map\u001b[0;34m(fn, tree, is_leaf, *rest)\u001b[0m\n\u001b[1;32m 43\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m TreeType(\n\u001b[1;32m 44\u001b[0m tree_map(fn, child, \u001b[38;5;241m*\u001b[39m(r[i] \u001b[38;5;28;01mfor\u001b[39;00m r \u001b[38;5;129;01min\u001b[39;00m rest), is_leaf\u001b[38;5;241m=\u001b[39mis_leaf)\n\u001b[1;32m 45\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i, child \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28menumerate\u001b[39m(tree)\n\u001b[1;32m 46\u001b[0m )\n\u001b[1;32m 47\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(tree, \u001b[38;5;28mdict\u001b[39m):\n\u001b[0;32m---> 48\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m {\n\u001b[1;32m 49\u001b[0m k: tree_map(fn, child, \u001b[38;5;241m*\u001b[39m(r[k] \u001b[38;5;28;01mfor\u001b[39;00m r \u001b[38;5;129;01min\u001b[39;00m rest), is_leaf\u001b[38;5;241m=\u001b[39mis_leaf)\n\u001b[1;32m 50\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m k, child \u001b[38;5;129;01min\u001b[39;00m tree\u001b[38;5;241m.\u001b[39mitems()\n\u001b[1;32m 51\u001b[0m }\n\u001b[1;32m 52\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 53\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m fn(tree, \u001b[38;5;241m*\u001b[39mrest)\n",
"File \u001b[0;32m~/miniforge3/lib/python3.10/site-packages/mlx/utils.py:49\u001b[0m, in \u001b[0;36m<dictcomp>\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 43\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m TreeType(\n\u001b[1;32m 44\u001b[0m tree_map(fn, child, \u001b[38;5;241m*\u001b[39m(r[i] \u001b[38;5;28;01mfor\u001b[39;00m r \u001b[38;5;129;01min\u001b[39;00m rest), is_leaf\u001b[38;5;241m=\u001b[39mis_leaf)\n\u001b[1;32m 45\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i, child \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28menumerate\u001b[39m(tree)\n\u001b[1;32m 46\u001b[0m )\n\u001b[1;32m 47\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(tree, \u001b[38;5;28mdict\u001b[39m):\n\u001b[1;32m 48\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m {\n\u001b[0;32m---> 49\u001b[0m k: \u001b[43mtree_map\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfn\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mchild\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mr\u001b[49m\u001b[43m[\u001b[49m\u001b[43mk\u001b[49m\u001b[43m]\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mr\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mrest\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mis_leaf\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mis_leaf\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 50\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m k, child \u001b[38;5;129;01min\u001b[39;00m tree\u001b[38;5;241m.\u001b[39mitems()\n\u001b[1;32m 51\u001b[0m }\n\u001b[1;32m 52\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 53\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m fn(tree, \u001b[38;5;241m*\u001b[39mrest)\n",
"File \u001b[0;32m~/miniforge3/lib/python3.10/site-packages/mlx/utils.py:48\u001b[0m, in \u001b[0;36mtree_map\u001b[0;34m(fn, tree, is_leaf, *rest)\u001b[0m\n\u001b[1;32m 43\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m TreeType(\n\u001b[1;32m 44\u001b[0m tree_map(fn, child, \u001b[38;5;241m*\u001b[39m(r[i] \u001b[38;5;28;01mfor\u001b[39;00m r \u001b[38;5;129;01min\u001b[39;00m rest), is_leaf\u001b[38;5;241m=\u001b[39mis_leaf)\n\u001b[1;32m 45\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i, child \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28menumerate\u001b[39m(tree)\n\u001b[1;32m 46\u001b[0m )\n\u001b[1;32m 47\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(tree, \u001b[38;5;28mdict\u001b[39m):\n\u001b[0;32m---> 48\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m {\n\u001b[1;32m 49\u001b[0m k: tree_map(fn, child, \u001b[38;5;241m*\u001b[39m(r[k] \u001b[38;5;28;01mfor\u001b[39;00m r \u001b[38;5;129;01min\u001b[39;00m rest), is_leaf\u001b[38;5;241m=\u001b[39mis_leaf)\n\u001b[1;32m 50\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m k, child \u001b[38;5;129;01min\u001b[39;00m tree\u001b[38;5;241m.\u001b[39mitems()\n\u001b[1;32m 51\u001b[0m }\n\u001b[1;32m 52\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 53\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m fn(tree, \u001b[38;5;241m*\u001b[39mrest)\n",
"File \u001b[0;32m~/miniforge3/lib/python3.10/site-packages/mlx/utils.py:49\u001b[0m, in \u001b[0;36m<dictcomp>\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 43\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m TreeType(\n\u001b[1;32m 44\u001b[0m tree_map(fn, child, \u001b[38;5;241m*\u001b[39m(r[i] \u001b[38;5;28;01mfor\u001b[39;00m r \u001b[38;5;129;01min\u001b[39;00m rest), is_leaf\u001b[38;5;241m=\u001b[39mis_leaf)\n\u001b[1;32m 45\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i, child \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28menumerate\u001b[39m(tree)\n\u001b[1;32m 46\u001b[0m )\n\u001b[1;32m 47\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(tree, \u001b[38;5;28mdict\u001b[39m):\n\u001b[1;32m 48\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m {\n\u001b[0;32m---> 49\u001b[0m k: \u001b[43mtree_map\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfn\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mchild\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mr\u001b[49m\u001b[43m[\u001b[49m\u001b[43mk\u001b[49m\u001b[43m]\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mr\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mrest\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mis_leaf\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mis_leaf\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 50\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m k, child \u001b[38;5;129;01min\u001b[39;00m tree\u001b[38;5;241m.\u001b[39mitems()\n\u001b[1;32m 51\u001b[0m }\n\u001b[1;32m 52\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 53\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m fn(tree, \u001b[38;5;241m*\u001b[39mrest)\n",
"File \u001b[0;32m~/miniforge3/lib/python3.10/site-packages/mlx/utils.py:43\u001b[0m, in \u001b[0;36mtree_map\u001b[0;34m(fn, tree, is_leaf, *rest)\u001b[0m\n\u001b[1;32m 41\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(tree, (\u001b[38;5;28mlist\u001b[39m, \u001b[38;5;28mtuple\u001b[39m)):\n\u001b[1;32m 42\u001b[0m TreeType \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mtype\u001b[39m(tree)\n\u001b[0;32m---> 43\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mTreeType\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 44\u001b[0m \u001b[43m \u001b[49m\u001b[43mtree_map\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfn\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mchild\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mr\u001b[49m\u001b[43m[\u001b[49m\u001b[43mi\u001b[49m\u001b[43m]\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mr\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mrest\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mis_leaf\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mis_leaf\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 45\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mi\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mchild\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43menumerate\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mtree\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 46\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 47\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(tree, \u001b[38;5;28mdict\u001b[39m):\n\u001b[1;32m 48\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m {\n\u001b[1;32m 49\u001b[0m k: tree_map(fn, child, \u001b[38;5;241m*\u001b[39m(r[k] \u001b[38;5;28;01mfor\u001b[39;00m r \u001b[38;5;129;01min\u001b[39;00m rest), is_leaf\u001b[38;5;241m=\u001b[39mis_leaf)\n\u001b[1;32m 50\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m k, child \u001b[38;5;129;01min\u001b[39;00m tree\u001b[38;5;241m.\u001b[39mitems()\n\u001b[1;32m 51\u001b[0m }\n",
"File \u001b[0;32m~/miniforge3/lib/python3.10/site-packages/mlx/utils.py:44\u001b[0m, in \u001b[0;36m<genexpr>\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 41\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(tree, (\u001b[38;5;28mlist\u001b[39m, \u001b[38;5;28mtuple\u001b[39m)):\n\u001b[1;32m 42\u001b[0m TreeType \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mtype\u001b[39m(tree)\n\u001b[1;32m 43\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m TreeType(\n\u001b[0;32m---> 44\u001b[0m \u001b[43mtree_map\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfn\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mchild\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mr\u001b[49m\u001b[43m[\u001b[49m\u001b[43mi\u001b[49m\u001b[43m]\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mr\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mrest\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mis_leaf\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mis_leaf\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 45\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i, child \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28menumerate\u001b[39m(tree)\n\u001b[1;32m 46\u001b[0m )\n\u001b[1;32m 47\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(tree, \u001b[38;5;28mdict\u001b[39m):\n\u001b[1;32m 48\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m {\n\u001b[1;32m 49\u001b[0m k: tree_map(fn, child, \u001b[38;5;241m*\u001b[39m(r[k] \u001b[38;5;28;01mfor\u001b[39;00m r \u001b[38;5;129;01min\u001b[39;00m rest), is_leaf\u001b[38;5;241m=\u001b[39mis_leaf)\n\u001b[1;32m 50\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m k, child \u001b[38;5;129;01min\u001b[39;00m tree\u001b[38;5;241m.\u001b[39mitems()\n\u001b[1;32m 51\u001b[0m }\n",
"File \u001b[0;32m~/miniforge3/lib/python3.10/site-packages/mlx/utils.py:48\u001b[0m, in \u001b[0;36mtree_map\u001b[0;34m(fn, tree, is_leaf, *rest)\u001b[0m\n\u001b[1;32m 43\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m TreeType(\n\u001b[1;32m 44\u001b[0m tree_map(fn, child, \u001b[38;5;241m*\u001b[39m(r[i] \u001b[38;5;28;01mfor\u001b[39;00m r \u001b[38;5;129;01min\u001b[39;00m rest), is_leaf\u001b[38;5;241m=\u001b[39mis_leaf)\n\u001b[1;32m 45\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i, child \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28menumerate\u001b[39m(tree)\n\u001b[1;32m 46\u001b[0m )\n\u001b[1;32m 47\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(tree, \u001b[38;5;28mdict\u001b[39m):\n\u001b[0;32m---> 48\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m {\n\u001b[1;32m 49\u001b[0m k: tree_map(fn, child, \u001b[38;5;241m*\u001b[39m(r[k] \u001b[38;5;28;01mfor\u001b[39;00m r \u001b[38;5;129;01min\u001b[39;00m rest), is_leaf\u001b[38;5;241m=\u001b[39mis_leaf)\n\u001b[1;32m 50\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m k, child \u001b[38;5;129;01min\u001b[39;00m tree\u001b[38;5;241m.\u001b[39mitems()\n\u001b[1;32m 51\u001b[0m }\n\u001b[1;32m 52\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 53\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m fn(tree, \u001b[38;5;241m*\u001b[39mrest)\n",
"File \u001b[0;32m~/miniforge3/lib/python3.10/site-packages/mlx/utils.py:49\u001b[0m, in \u001b[0;36m<dictcomp>\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 43\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m TreeType(\n\u001b[1;32m 44\u001b[0m tree_map(fn, child, \u001b[38;5;241m*\u001b[39m(r[i] \u001b[38;5;28;01mfor\u001b[39;00m r \u001b[38;5;129;01min\u001b[39;00m rest), is_leaf\u001b[38;5;241m=\u001b[39mis_leaf)\n\u001b[1;32m 45\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i, child \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28menumerate\u001b[39m(tree)\n\u001b[1;32m 46\u001b[0m )\n\u001b[1;32m 47\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(tree, \u001b[38;5;28mdict\u001b[39m):\n\u001b[1;32m 48\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m {\n\u001b[0;32m---> 49\u001b[0m k: \u001b[43mtree_map\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfn\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mchild\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mr\u001b[49m\u001b[43m[\u001b[49m\u001b[43mk\u001b[49m\u001b[43m]\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mr\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mrest\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mis_leaf\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mis_leaf\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 50\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m k, child \u001b[38;5;129;01min\u001b[39;00m tree\u001b[38;5;241m.\u001b[39mitems()\n\u001b[1;32m 51\u001b[0m }\n\u001b[1;32m 52\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 53\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m fn(tree, \u001b[38;5;241m*\u001b[39mrest)\n",
"File \u001b[0;32m~/miniforge3/lib/python3.10/site-packages/mlx/utils.py:43\u001b[0m, in \u001b[0;36mtree_map\u001b[0;34m(fn, tree, is_leaf, *rest)\u001b[0m\n\u001b[1;32m 41\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(tree, (\u001b[38;5;28mlist\u001b[39m, \u001b[38;5;28mtuple\u001b[39m)):\n\u001b[1;32m 42\u001b[0m TreeType \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mtype\u001b[39m(tree)\n\u001b[0;32m---> 43\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mTreeType\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 44\u001b[0m \u001b[43m \u001b[49m\u001b[43mtree_map\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfn\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mchild\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mr\u001b[49m\u001b[43m[\u001b[49m\u001b[43mi\u001b[49m\u001b[43m]\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mr\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mrest\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mis_leaf\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mis_leaf\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 45\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mi\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mchild\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43menumerate\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mtree\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 46\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 47\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(tree, \u001b[38;5;28mdict\u001b[39m):\n\u001b[1;32m 48\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m {\n\u001b[1;32m 49\u001b[0m k: tree_map(fn, child, \u001b[38;5;241m*\u001b[39m(r[k] \u001b[38;5;28;01mfor\u001b[39;00m r \u001b[38;5;129;01min\u001b[39;00m rest), is_leaf\u001b[38;5;241m=\u001b[39mis_leaf)\n\u001b[1;32m 50\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m k, child \u001b[38;5;129;01min\u001b[39;00m tree\u001b[38;5;241m.\u001b[39mitems()\n\u001b[1;32m 51\u001b[0m }\n",
"File \u001b[0;32m~/miniforge3/lib/python3.10/site-packages/mlx/utils.py:44\u001b[0m, in \u001b[0;36m<genexpr>\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 41\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(tree, (\u001b[38;5;28mlist\u001b[39m, \u001b[38;5;28mtuple\u001b[39m)):\n\u001b[1;32m 42\u001b[0m TreeType \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mtype\u001b[39m(tree)\n\u001b[1;32m 43\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m TreeType(\n\u001b[0;32m---> 44\u001b[0m \u001b[43mtree_map\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfn\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mchild\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mr\u001b[49m\u001b[43m[\u001b[49m\u001b[43mi\u001b[49m\u001b[43m]\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mr\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mrest\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mis_leaf\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mis_leaf\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 45\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i, child \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28menumerate\u001b[39m(tree)\n\u001b[1;32m 46\u001b[0m )\n\u001b[1;32m 47\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(tree, \u001b[38;5;28mdict\u001b[39m):\n\u001b[1;32m 48\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m {\n\u001b[1;32m 49\u001b[0m k: tree_map(fn, child, \u001b[38;5;241m*\u001b[39m(r[k] \u001b[38;5;28;01mfor\u001b[39;00m r \u001b[38;5;129;01min\u001b[39;00m rest), is_leaf\u001b[38;5;241m=\u001b[39mis_leaf)\n\u001b[1;32m 50\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m k, child \u001b[38;5;129;01min\u001b[39;00m tree\u001b[38;5;241m.\u001b[39mitems()\n\u001b[1;32m 51\u001b[0m }\n",
"File \u001b[0;32m~/miniforge3/lib/python3.10/site-packages/mlx/utils.py:48\u001b[0m, in \u001b[0;36mtree_map\u001b[0;34m(fn, tree, is_leaf, *rest)\u001b[0m\n\u001b[1;32m 43\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m TreeType(\n\u001b[1;32m 44\u001b[0m tree_map(fn, child, \u001b[38;5;241m*\u001b[39m(r[i] \u001b[38;5;28;01mfor\u001b[39;00m r \u001b[38;5;129;01min\u001b[39;00m rest), is_leaf\u001b[38;5;241m=\u001b[39mis_leaf)\n\u001b[1;32m 45\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i, child \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28menumerate\u001b[39m(tree)\n\u001b[1;32m 46\u001b[0m )\n\u001b[1;32m 47\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(tree, \u001b[38;5;28mdict\u001b[39m):\n\u001b[0;32m---> 48\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m {\n\u001b[1;32m 49\u001b[0m k: tree_map(fn, child, \u001b[38;5;241m*\u001b[39m(r[k] \u001b[38;5;28;01mfor\u001b[39;00m r \u001b[38;5;129;01min\u001b[39;00m rest), is_leaf\u001b[38;5;241m=\u001b[39mis_leaf)\n\u001b[1;32m 50\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m k, child \u001b[38;5;129;01min\u001b[39;00m tree\u001b[38;5;241m.\u001b[39mitems()\n\u001b[1;32m 51\u001b[0m }\n\u001b[1;32m 52\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 53\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m fn(tree, \u001b[38;5;241m*\u001b[39mrest)\n",
"File \u001b[0;32m~/miniforge3/lib/python3.10/site-packages/mlx/utils.py:49\u001b[0m, in \u001b[0;36m<dictcomp>\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 43\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m TreeType(\n\u001b[1;32m 44\u001b[0m tree_map(fn, child, \u001b[38;5;241m*\u001b[39m(r[i] \u001b[38;5;28;01mfor\u001b[39;00m r \u001b[38;5;129;01min\u001b[39;00m rest), is_leaf\u001b[38;5;241m=\u001b[39mis_leaf)\n\u001b[1;32m 45\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i, child \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28menumerate\u001b[39m(tree)\n\u001b[1;32m 46\u001b[0m )\n\u001b[1;32m 47\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(tree, \u001b[38;5;28mdict\u001b[39m):\n\u001b[1;32m 48\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m {\n\u001b[0;32m---> 49\u001b[0m k: \u001b[43mtree_map\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfn\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mchild\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mr\u001b[49m\u001b[43m[\u001b[49m\u001b[43mk\u001b[49m\u001b[43m]\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mr\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mrest\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mis_leaf\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mis_leaf\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 50\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m k, child \u001b[38;5;129;01min\u001b[39;00m tree\u001b[38;5;241m.\u001b[39mitems()\n\u001b[1;32m 51\u001b[0m }\n\u001b[1;32m 52\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 53\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m fn(tree, \u001b[38;5;241m*\u001b[39mrest)\n",
"File \u001b[0;32m~/miniforge3/lib/python3.10/site-packages/mlx/utils.py:53\u001b[0m, in \u001b[0;36mtree_map\u001b[0;34m(fn, tree, is_leaf, *rest)\u001b[0m\n\u001b[1;32m 48\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m {\n\u001b[1;32m 49\u001b[0m k: tree_map(fn, child, \u001b[38;5;241m*\u001b[39m(r[k] \u001b[38;5;28;01mfor\u001b[39;00m r \u001b[38;5;129;01min\u001b[39;00m rest), is_leaf\u001b[38;5;241m=\u001b[39mis_leaf)\n\u001b[1;32m 50\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m k, child \u001b[38;5;129;01min\u001b[39;00m tree\u001b[38;5;241m.\u001b[39mitems()\n\u001b[1;32m 51\u001b[0m }\n\u001b[1;32m 52\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m---> 53\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfn\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtree\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mrest\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/miniforge3/lib/python3.10/site-packages/mlx/optimizers/optimizers.py:426\u001b[0m, in \u001b[0;36mAdam.apply_single\u001b[0;34m(self, gradient, parameter, state)\u001b[0m\n\u001b[1;32m 424\u001b[0m v \u001b[38;5;241m=\u001b[39m state[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mv\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[1;32m 425\u001b[0m m \u001b[38;5;241m=\u001b[39m b1 \u001b[38;5;241m*\u001b[39m m \u001b[38;5;241m+\u001b[39m (\u001b[38;5;241m1\u001b[39m \u001b[38;5;241m-\u001b[39m b1) \u001b[38;5;241m*\u001b[39m gradient\n\u001b[0;32m--> 426\u001b[0m v \u001b[38;5;241m=\u001b[39m b2 \u001b[38;5;241m*\u001b[39m v \u001b[38;5;241m+\u001b[39m (\u001b[38;5;241m1\u001b[39m \u001b[38;5;241m-\u001b[39m b2) \u001b[38;5;241m*\u001b[39m \u001b[43mmx\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msquare\u001b[49m\u001b[43m(\u001b[49m\u001b[43mgradient\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 427\u001b[0m state[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mm\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m m\n\u001b[1;32m 428\u001b[0m state[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mv\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m v\n",
"\u001b[0;31mKeyboardInterrupt\u001b[0m: "
2024-07-26 21:07:40 +08:00
]
}
],
"source": [
"batch_size = 8\n",
"cur_step = 0\n",
"mean_generator_loss = 0\n",
"mean_discriminator_loss = 0\n",
"error = False\n",
"\n",
2024-07-26 21:36:29 +08:00
"D_loss_grad = nn.value_and_grad(disc, disc_loss)\n",
"G_loss_grad = nn.value_and_grad(gen, gen_loss)\n",
"\n",
"\n",
2024-07-27 05:19:08 +08:00
"for epoch in range(10):\n",
2024-07-26 21:07:40 +08:00
" \n",
" # Dataloader returns the batches\n",
2024-07-27 05:19:08 +08:00
" # for real in tqdm(batch_iterate(batch_size, train_images)):\n",
" \n",
" for real in tqdm(train_images):\n",
2024-07-26 21:07:40 +08:00
"\n",
2024-07-27 05:19:08 +08:00
" \n",
" # real = real.reshape(-1)\n",
" \n",
2024-07-26 21:07:40 +08:00
" # Flatten the batch of real images from the dataset\n",
2024-07-27 05:19:08 +08:00
" \n",
" # plt.imshow(real[0].reshape(28,28))\n",
" # print(len(real))\n",
" # break\n",
2024-07-26 21:07:40 +08:00
" \n",
2024-07-26 21:36:29 +08:00
" D_loss,D_grads = D_loss_grad(gen, disc, real, batch_size, z_dim)\n",
2024-07-26 21:07:40 +08:00
"\n",
" # Update optimizer\n",
2024-07-26 21:36:29 +08:00
" disc_opt.update(disc, D_grads)\n",
2024-07-26 21:07:40 +08:00
" \n",
2024-07-26 21:36:29 +08:00
" # Update gradients\n",
" \n",
" G_loss,G_grads = G_loss_grad(gen, disc, batch_size, z_dim)\n",
" \n",
" # Update optimizer\n",
" gen_opt.update(gen, G_grads)\n",
" \n",
" # Update gradients\n",
2024-07-26 21:07:40 +08:00
"\n",
"\n",
2024-07-26 21:36:29 +08:00
" # # Keep track of the average discriminator loss\n",
" # mean_discriminator_loss += disc_loss.item() / display_step\n",
2024-07-26 21:07:40 +08:00
"\n",
2024-07-26 21:36:29 +08:00
" # # Keep track of the average generator loss\n",
" # mean_generator_loss += gen_loss.item() / display_step\n",
2024-07-26 21:07:40 +08:00
"\n",
2024-07-26 21:36:29 +08:00
" # ### Visualization code ###\n",
" # if cur_step % display_step == 0 and cur_step > 0:\n",
" # print(f\"Step {cur_step}: Generator loss: {mean_generator_loss}, discriminator loss: {mean_discriminator_loss}\")\n",
" # fake_noise = get_noise(cur_batch_size, z_dim, device=device)\n",
" # fake = gen(fake_noise)\n",
" # show_tensor_images(fake)\n",
" # show_tensor_images(real)\n",
" # mean_generator_loss = 0\n",
" # mean_discriminator_loss = 0\n",
" # cur_step += 1\n"
2024-07-26 21:07:40 +08:00
]
2024-07-27 05:19:08 +08:00
},
{
"cell_type": "code",
"execution_count": 90,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Shapes..... (1,) (784, 1)\n"
]
},
{
"ename": "ValueError",
"evalue": "Inputs shape (1,) does not match targets shape (784, 1).",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[90], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mdisc_loss\u001b[49m\u001b[43m(\u001b[49m\u001b[43mgen\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdisc\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mreal\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mbatch_size\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mz_dim\u001b[49m\u001b[43m)\u001b[49m\n",
"Cell \u001b[0;32mIn[89], line 14\u001b[0m, in \u001b[0;36mdisc_loss\u001b[0;34m(gen, disc, real, num_images, z_dim)\u001b[0m\n\u001b[1;32m 11\u001b[0m real_labels \u001b[38;5;241m=\u001b[39m mx\u001b[38;5;241m.\u001b[39mones((real\u001b[38;5;241m.\u001b[39mshape[\u001b[38;5;241m0\u001b[39m],\u001b[38;5;241m1\u001b[39m))\n\u001b[1;32m 13\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mShapes.....\u001b[39m\u001b[38;5;124m'\u001b[39m,real_disc\u001b[38;5;241m.\u001b[39mshape,real_labels\u001b[38;5;241m.\u001b[39mshape)\n\u001b[0;32m---> 14\u001b[0m real_loss \u001b[38;5;241m=\u001b[39m \u001b[43mnn\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mlosses\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mbinary_cross_entropy\u001b[49m\u001b[43m(\u001b[49m\u001b[43mreal_disc\u001b[49m\u001b[43m,\u001b[49m\u001b[43mreal_labels\u001b[49m\u001b[43m,\u001b[49m\u001b[43mwith_logits\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m)\u001b[49m\n\u001b[1;32m 16\u001b[0m disc_loss \u001b[38;5;241m=\u001b[39m (fake_loss \u001b[38;5;241m+\u001b[39m real_loss) \u001b[38;5;241m/\u001b[39m \u001b[38;5;241m2\u001b[39m\n\u001b[1;32m 18\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m disc_loss\n",
"File \u001b[0;32m~/miniforge3/lib/python3.10/site-packages/mlx/nn/losses.py:155\u001b[0m, in \u001b[0;36mbinary_cross_entropy\u001b[0;34m(inputs, targets, weights, with_logits, reduction)\u001b[0m\n\u001b[1;32m 124\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 125\u001b[0m \u001b[38;5;124;03mComputes the binary cross entropy loss.\u001b[39;00m\n\u001b[1;32m 126\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 152\u001b[0m \u001b[38;5;124;03m array(0.510826, dtype=float32)\u001b[39;00m\n\u001b[1;32m 153\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 154\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m inputs\u001b[38;5;241m.\u001b[39mshape \u001b[38;5;241m!=\u001b[39m targets\u001b[38;5;241m.\u001b[39mshape:\n\u001b[0;32m--> 155\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[1;32m 156\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mInputs shape \u001b[39m\u001b[38;5;132;01m{\u001b[39;00minputs\u001b[38;5;241m.\u001b[39mshape\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m does not match targets shape \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mtargets\u001b[38;5;241m.\u001b[39mshape\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 157\u001b[0m )\n\u001b[1;32m 159\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m with_logits:\n\u001b[1;32m 160\u001b[0m loss \u001b[38;5;241m=\u001b[39m mx\u001b[38;5;241m.\u001b[39mlogaddexp(\u001b[38;5;241m0.0\u001b[39m, inputs) \u001b[38;5;241m-\u001b[39m inputs \u001b[38;5;241m*\u001b[39m targets\n",
"\u001b[0;31mValueError\u001b[0m: Inputs shape (1,) does not match targets shape (784, 1)."
]
}
],
"source": [
"disc_loss(gen, disc, real, batch_size, z_dim)"
]
},
{
"cell_type": "code",
"execution_count": 86,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"784"
]
},
"execution_count": 86,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"real.shape[0]"
]
},
{
"cell_type": "code",
"execution_count": 47,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(8, 784)"
]
},
"execution_count": 47,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"real.shape"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"real.reshape((-1,len(real))).shape"
]
2024-07-26 21:07:40 +08:00
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.10"
}
},
"nbformat": 4,
"nbformat_minor": 2
}