This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import enum | |
import json | |
import sys | |
from typing import Any, Dict, Iterable, List, TextIO, Union | |
DOUBLE_UNDERSCORE = '__' | |
SPACE = ' ' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from IPython.display import clear_output | |
from torch.autograd import Variable | |
w = torch.tensor(np.random.rand(10).astype('float32')/10, requires_grad=True) | |
x = torch.tensor(boston.data[:, -1] / 10, dtype=torch.float32) | |
y = torch.tensor(boston.target, dtype=torch.float32) | |
relu = lambda x: torch.max(torch.zeros_like(x), x ) | |
for i in range(1000): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Connect with me if you want more packages. | |
docker run --rm -it --user root -w /home/jovyan/shared -v $(pwd):/home/jovyan/shared -p 8888:8888 --name nlpj nickveld/nlp_ru_notebook start-notebook.sh --NotebookApp.token='' | |
# --rm Automatically remove the container when it exits. If you can start container, remove it. | |
# -it Show stdout and stderr, and let write to stdin (in this case let send stop signal with Ctrl+C) | |
# --user root In Notebook Terminal you can do operations with root rights | |
# Instead of $(pwd) you can write a directory on your device | |
# -p port_of_your_device:8888 (8888 - is a default Jupyter Notebook port) Using -p option is as setting simple NAT configuration | |
# --name name_of_container | |
# start-notebook.sh --NotebookApp.token='' - disable auth, if you want to auth and can do it delete or transform start-notebook.sh --NotebookApp.token='' | |
# More on https://hub.docker.com/r/jupyter/base-notebook/ |