Commit b5faa3f8 authored by Carsten Eie Frigaard's avatar Carsten Eie Frigaard
Browse files

final_l07_update_and_fix_of_pagenumbers_in_l06

parent 04daff05
No preview for this file type
%% Cell type:markdown id: tags:
# ITMAL Notebook
# SWMAL Notebook
## Quickstart demo..
Running on the GPU-cluster (gpucluster.st.lab.au.dk).
See details in
See details in "Brightspace SWMAL | Kursusinformation | GPU Cluster"
* https://brightspace.au.dk/d2l/le/lessons/27524/topics/296678
* https://brightspace.au.dk/d2l/le/lessons/53939/topics/791961
REVISIONS| |
---------| |
2018-????| CEF, initial.
2021-0407| CEF, updated, added header text and long-running section.
2021-1026| CEF, minor lesson number update added more intro text.
2018-??-??| CEF, initial.
2021-04-07| CEF, updated, added header text and long-running section.
2021-10-26| CEF, minor lesson number update added more intro text.
2022-03-21| CEF, updated for SWMAL F22, changed url links, updated img links.
%% Cell type:markdown id: tags:
### Get ITMAL GIT repository
Clone [GITMAL] via the shell command '!'..
%% Cell type:code id: tags:
``` python
! test -d ~/itmal || (echo "Cloning GITMAL.." && git clone https://cfrigaard@bitbucket.org/cfrigaard/itmal)
! cd ~/itmal && git pull
```
%% Cell type:markdown id: tags:
### Test Python Paths
This cell just test if the startup-sequence has been run..
(startup-sequence placed in `~/.ipython/profile_default/startup /00_init.py`, that is a softlink to `/home/shared/00_init.py`.)
%% Cell type:code id: tags:
``` python
import sys
p=sys.path
print(f"Your current path=")
itmal_found_in_path=False
for i in p:
print(f" {i}")
n=i.find("/itmal")
if n>0:
itmal_found_in_path=True
assert itmal_found_in_path, "ups, 'itmal' dir not present in system path...you are in trouble!"
print("OK")
```
%% Cell type:markdown id: tags:
### Test ITMAL library
Now, import some functions form 'libitmal'..
%% Cell type:code id: tags:
``` python
from libitmal import versions as ver
ver.Versions()
```
%% Cell type:markdown id: tags:
If it went well, you should see version like
```Python version: 3.8.3.
Scikit-learn version: 0.23.1.
Keras version: 2.4.3
Tensorflow version: 2.2.0
Tensorflow.keras version: 2.3.0-tf```
%% Cell type:markdown id: tags:
### Long-running cells in JupyterHub
...and how to capture output from 'em after closing Your browser or Your VPN connection.
### Step 1
First use the `%%capture` magic command in a long-running cell---the cell below also sets the 'done' flag to false.
### Step 2
Run the cell, and close you browser.
%% Cell type:code id: tags:
``` python
%%capture output
import time
t=20
done=False #
print("Jupyter Hub test..")
print(f" long running cell, sleep for {t} seconds..")
print(f" beg: {time.ctime()}")
time.sleep(t)
print(f" end: {time.ctime()}")
done=True
```
%% Cell type:markdown id: tags:
### Step 3
Finally come back to the node you launched the long-running cell on and see if the `done` flag is marked as `True`, then the captured output can be printed, see this in the second cell
%% Cell type:code id: tags:
``` python
#print(f"done={done}")
if done:
output.show() # displays captured output
else:
print("cell above still seem to be running, wait some more..")
```
%% Cell type:markdown id: tags:
You can connect to running jupyter Notebooks via
<img src="https://itundervisning.ase.au.dk/GITMAL/L07/Figs/Screenshot_juptyterhub_running_cells.png"
<img src="https://itundervisning.ase.au.dk/SWMAL/L07/Figs/Screenshot_juptyterhub_running_cells.png"
alt="WARNING: could not get image from server." style="height:500px">
Beware that the star "[*]" wont show up as expected, when reconnection: the cell might be running even if no star "[ ]" is showing!
<img src="https://itundervisning.ase.au.dk/GITMAL/L07/Figs/Screenshot_juptyterhub_running_cells_missing_star.png"
<img src="https://itundervisning.ase.au.dk/SWMAL/L07/Figs/Screenshot_juptyterhub_running_cells_missing_star.png"
alt="WARNING: could not get image from server." style="height:500px">
......
No preview for this file type
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment