Skip to content

Instantly share code, notes, and snippets.

View abderhasan's full-sized avatar

Dr. Abder-Rahman Ali abderhasan

View GitHub Profile
# A script that moves files to another directory, and renames any files already
# present in the output directory
import os
import os.path
from PIL import Image
import shutil
import argparse as ap
from pathlib import Path
import torch
def f(x):
return x**3 + (2 * x)
x = torch.tensor(2.).requires_grad_()
y = f(x)
y.backward() #derivative
print(x.grad)
How to install fastai on AWS?
After you launch an AWS Ubuntu instance, do the following:
$ git clone https://github.com/fastai/fastai
$ wget https://repo.continuum.io/archive/Anaconda3-5.0.0.1-Linux-x86_64.sh
$ bash Anaconda3-5.0.0.1-Linux-x86_64.sh
$ source .bashrc
$ cd fastai
$ conda env update