Log into your server with ssh, something like
ssh -i "my_secret.pem" ubuntu@12.123.12.123If it's a new server, you'll need to install a few things.
Install conda with
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| import bs4 | |
| def xpath_soup(element): | |
| # type: (typing.Union[bs4.element.Tag, bs4.element.NavigableString]) -> str | |
| """ | |
| Generate xpath from BeautifulSoup4 element. |
| """ | |
| Shows how to do a cross join (i.e. cartesian product) between two pandas DataFrames using an example on | |
| calculating the distances between origin and destination cities. | |
| Tested with pandas 0.17.1 and 0.18 on Python 3.4 and Python 3.5 | |
| Best run this with Spyder (see https://github.com/spyder-ide/spyder) | |
| Author: Markus Konrad <post@mkonrad.net> | |
| April 2016 |
| import math | |
| from torch.optim.optimizer import Optimizer | |
| # This version of Adam keeps an fp32 copy of the parameters and | |
| # does all of the parameter updates in fp32, while still doing the | |
| # forwards and backwards passes using fp16 (i.e. fp16 copies of the | |
| # parameters and fp16 activations). | |
| # | |
| # Note that this calls .float().cuda() on the params such that it | |
| # moves them to gpu 0--if you're using a different GPU or want to |
| from keras.callbacks import Callback | |
| import keras.backend as K | |
| import numpy as np | |
| class SGDRScheduler(Callback): | |
| '''Cosine annealing learning rate scheduler with periodic restarts. | |
| # Usage | |
| ```python | |
| schedule = SGDRScheduler(min_lr=1e-5, |
| # install chromium, its driver, and selenium | |
| !apt update | |
| !apt install libu2f-udev libvulkan1 | |
| !wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
| !dpkg -i google-chrome-stable_current_amd64.deb | |
| !wget https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.70/linux64/chromedriver-linux64.zip | |
| !unzip -j chromedriver-linux64.zip chromedriver-linux64/chromedriver -d /usr/local/bin/ | |
| !pip install selenium chromedriver_autoinstaller | |
| # set options to be headless, .. |
| from fastai import * | |
| from fastai.tabular import * | |
| from fastai.vision import * | |
| PATH = os.path.abspath('..') | |
| # distinguish categorical and continuous variables, and dependent variable | |
| cat_names = ['cat1', 'cat2', 'cat3'] | |
| cont_names =['cont1', 'cont2'] | |
| dep_var = 'target' |
Log into your server with ssh, something like
ssh -i "my_secret.pem" ubuntu@12.123.12.123If it's a new server, you'll need to install a few things.
Install conda with
| /* | |
| * credit to Dhrumil Shah (@wandcrafting) and Robert Haisfield (@RobertHaisfield) | |
| * for the original concept which was part of their RoamGames submission | |
| * and can be found at: https://www.figma.com/file/5shwLdUCHxSaPNEO7pazbe/ | |
| * | |
| */ | |
| /* ======= OPTIONS ======== */ | |
| /* note: if you change these, reload the page to see the effect */ |