<jupyter_start><jupyter_text>Animation of Training Set<jupyter_code>from pathlib import Path
filenames = list(Path('/content/training_results/SRF_4/').glob('*.png'))
filenames.sort()
from PIL import Image as Im
img_list = list(map(lambda x:Im.open(x), filenames))
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from IPython.display import HTML
#%%capture
fig = plt.figure(figsize=(10,8))
plt.axis("off")
ims = [[plt.imshow(i, animated=True)] for i in img_list]
ani = animation.ArtistAnimation(fig, ims, interval=1000, repeat_delay=1000, blit=True)

HTML(ani.to_jshtml())
!sudo apt install imagemagick
ani.save(f'{S8_PROJECT}srgan.gif', writer='imagemagick', fps=60)<jupyter_output>Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  fonts-droid-fallback fonts-noto-mono ghostscript gsfonts
  imagemagick-6-common imagemagick-6.q16 libcupsfilters1 libcupsimage2
  libdjvulibre-text libdjvulibre21 libgs9 libgs9-common libijs-0.35
  libjbig2dec0 liblqr-1-0 libmagickcore-6.q16-3 libmagickcore-6.q16-3-extra
  libmagickwand-6.q16-3 libnetpbm10 libwmf0.2-7 netpbm poppler-data
Suggested packages:
  fonts-noto ghostscript-x imagemagick-doc autotrace cups-bsd | lpr | lprng
  enscript gimp gnuplot grads hp2xx html2ps libwmf-bin mplayer povray radiance
  sane-utils texlive-base-bin transfig ufraw-batch inkscape libjxr-tools
  libwmf0.2-7-gtk poppler-utils fonts-japanese-mincho | fonts-ipafont-mincho
  fonts-japanese-gothic | fonts-ipafont-gothic fonts-arphic-ukai
  fonts-arphic-uming fonts-nanum
The following NEW packages will be installed:
  fonts-droid-fallback fonts-noto-mono g[...]<jupyter_text>Plotting of Curves Generator Discrimantor Loss<jupyter_code>import pandas as pd
results = pd.read_csv('/content/statistics/srf_4_train_results.csv')
plt.figure(figsize=(8,8))
plt.title("Loss vs Epoch")
plt.plot(results['Loss_D'], label = "Discriminator Loss")
plt.plot(results['Loss_G'], label = "Generator Loss")
plt.xlabel("Epoch")
plt.ylabel("Loss")
plt.legend(loc="best")<jupyter_output><empty_output><jupyter_text>PSNR SSIM Trends<jupyter_code>fig, axs = plt.subplots(1,2,figsize=(16,8))
axs[0].set_title("Peak Signal to Noise Ratio")
axs[0].plot(results['PSNR'], label = "Test-PSNR")
axs[0].set_xlabel("Epoch")
axs[0].set_ylabel("PSNR")
axs[0].legend(loc="best")

axs[1].set_title("Structural Similarity Index")
axs[1].plot(results['SSIM'], label = "Test-SSIM")
axs[1].set_xlabel("Epoch")
axs[1].set_ylabel("SSIM")
axs[1].legend(loc="best")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1337432744043044, 'fraction_numerical': 0.027671022290545733, 'mean_word_length': 6.501440922190202, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '424242', 'license': 'MIT', 'n_tokens_mistral': 1060, 'n_tokens_neox': 1000, 'n_words': 189, 'path': 'S8/srgan/SRGAN.ipynb', 'repo_name': 'pankaj90382/TSAI-2', 'size': '2602'}