<jupyter_start><jupyter_text>Google CoLab demo Working with nn4omtf packageDownload this notebook into your drive and go through it in your CoLab session.<jupyter_code># See what we have under the hood :)
!lscpu
!free -h
!df / -h
# Download required packages
!git clone https://github.com/jlysiak/fuw-nn4omtf.git
!git clone https://github.com/jlysiak/fuw-nn4omtf-cli.git
!git clone https://github.com/jlysiak/fuw-nn4omtf-demo.git
# See what we have
!ls
# Install nn4omtf package and dependencies.
# `make tf=cpu` starts installation of TensorFlow package
# but CoLab has appropriate TF version installed, so run `make nn4omtf` only.
!cd fuw-nn4omtf/ && make nn4omtf
# Install nn4omtf-cli 
!cd fuw-nn4omtf-cli/ && ./install
# Export paths 
# This workaround is required due to we work now inside jupyter notebook session
import os
os.environ['PATH'] = os.environ['PATH'] + ':/root/.nn4omtf_cli'<jupyter_output><empty_output><jupyter_text>Everything installed.Now go to `fuw-nn4omtf-demo` and check `Makefile` contents.  There are commands to create, train and test model.  This demo repo has datasets to perform all model's developement stages.To see exact commads read `Makefile`.   Run scripts with `--help` flag to see more info.<jupyter_code>!cat fuw-nn4omtf-demo/Makefile
!cd fuw-nn4omtf-demo && make 2-create-model
# See how network builder code looks like
!cat fuw-nn4omtf-demo/test-model/builder.py
# Run training using CPU
!cd fuw-nn4omtf-demo && make 3-train-model
# Evaluate trained model
!cd fuw-nn4omtf-demo && make 4-test-model
# Output logits are saved here
!ls fuw-nn4omtf-demo/test-model/test-outputs/
!cd fuw-nn4omtf-demo && make 5-plot
# Generated plots
!cd fuw-nn4omtf-demo && ls plots
# Show generated images
from IPython.display import display, Image
from glob import glob
import PIL

images = [ PIL.Image.open(f) for f in glob('fuw-nn4omtf-demo/plots/TEST_STATISTICS/*') ]
images += [ PIL.Image.open(f) for f in glob('fuw-nn4omtf-demo/plots/DATASET_STATISTICS/*') ]
for im in images:
    print("-" * 180)
    print(im.filename)
    display(Image(filename=im.filename, retina=True))<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup