Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
import PIL.Image | |
from cStringIO import StringIO | |
import IPython.display | |
import numpy as np | |
def showarray(a, fmt='png'): | |
a = np.uint8(a) | |
f = StringIO() | |
PIL.Image.fromarray(a).save(f, fmt) | |
IPython.display.display(IPython.display.Image(data=f.getvalue())) |
# https://people.eecs.berkeley.edu/~kjamieson/hyperband.html | |
# you need to write the following hooks for your custom problem | |
from problem import get_random_hyperparameter_configuration,run_then_return_val_loss | |
max_iter = 81 # maximum iterations/epochs per configuration | |
eta = 3 # defines downsampling rate (default=3) | |
logeta = lambda x: log(x)/log(eta) | |
s_max = int(logeta(max_iter)) # number of unique executions of Successive Halving (minus one) | |
B = (s_max+1)*max_iter # total number of iterations (without reuse) per execution of Succesive Halving (n,r) |
Name | t | |
---|---|---|
Jovan | 0.143522377788 | |
Wilford | 0.171813290491 | |
Newton | 0.192343843426 | |
Maurice | 0.193607112432 | |
Emmanuel | 0.20571087052 | |
Joseph | 0.210762071958 | |
Milton | 0.21296788724 | |
Ahmad | 0.214983745995 | |
Julius | 0.218052193228 |
$ \newcommand{\aB}{\mathbf{a}} \newcommand{\bB}{\mathbf{b}} \newcommand{\cB}{\mathbf{c}} \newcommand{\dB}{\mathbf{d}} \newcommand{\eB}{\mathbf{e}} \newcommand{\fB}{\mathbf{f}} \newcommand{\gB}{\mathbf{g}} \newcommand{\hB}{\mathbf{h}} \newcommand{\iB}{\mathbf{i}}
Neovim and Vim both come bundled with a standard plugin called Netrw. Netrw acts a file explorer (similar to NERDTree), but more importantly has the ability to work with scp (as well as sftp, rcp, ftp, and lots of others :h netrw-nread
) to let you edit files and browse directories that are hosted on a remote machine, inside of your local Vim instance.
This is useful since you are able to use your Vim setup and plugins without copying over your dotfiles to the remote machine. As well, since the file is copied to your local machine, there will be no delay when typing.
This is optional for Vim, but required for Neovim (check this Neovim issue explaining why).
def top_k_top_p_filtering(logits, top_k=0, top_p=0.0, filter_value=-float('Inf')): | |
""" Filter a distribution of logits using top-k and/or nucleus (top-p) filtering | |
Args: | |
logits: logits distribution shape (vocabulary size) | |
top_k >0: keep only top k tokens with highest probability (top-k filtering). | |
top_p >0.0: keep the top tokens with cumulative probability >= top_p (nucleus filtering). | |
Nucleus filtering is described in Holtzman et al. (http://arxiv.org/abs/1904.09751) | |
""" | |
assert logits.dim() == 1 # batch size 1 for now - could be updated for more but the code would be less clear | |
top_k = min(top_k, logits.size(-1)) # Safety check |