I hereby claim:
- I am butchland on github.
- I am butchland (https://keybase.io/butchland) on keybase.
- I have a public key ASBvBzjyR_hRPyRKgjiRO07GVwQ8Lr2kNAq3m_fvVBM_lgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# Run the model 1 pass forward (with grad enabled) | |
import fastai_xla_extensions.core | |
from fastai2.text.all import * | |
import torch_xla.debug.metrics as met | |
import torch_xla.core.xla_model as xm | |
# from my_timesaver_utils.profiling_callback import * | |
path = untar_data(URLs.IMDB_SAMPLE) | |
df = pd.read_csv(path/'texts.csv') | |
dls = TextDataLoaders.from_df(df,path=path, text_col='text', label_col='label', |
import fastai_xla_extensions.core | |
from fastai2.text.all import * | |
import torch_xla.debug.metrics as met | |
# from my_timesaver_utils.profiling_callback import * | |
path = untar_data(URLs.IMDB_SAMPLE) | |
df = pd.read_csv(path/'texts.csv') | |
dls = TextDataLoaders.from_df(df,path=path, text_col='text', label_col='label', valid_col='is_valid') | |
learner = text_classifier_learner(dls, AWD_LSTM, drop_mult=0.5, metrics=accuracy) |
#!/bin/bash | |
# simplifying this script as per Jeremy Howard's post | |
# here https://forums.fast.ai/t/major-new-changes-and-features/40742/18 | |
LC_ALL=C find . -type f -name '*.ipynb' -exec sed -i '' s/begin_fit/before_fit/g {} + | |
LC_ALL=C find . -type f -name '*.ipynb' -exec sed -i '' s/begin_epoch/before_epoch/g {} + | |
LC_ALL=C find . -type f -name '*.ipynb' -exec sed -i '' s/begin_train/before_train/g {} + | |
LC_ALL=C find . -type f -name '*.ipynb' -exec sed -i '' s/begin_batch/before_batch/g {} + | |
LC_ALL=C find . -type f -name '*.ipynb' -exec sed -i '' s/begin_validate/before_validate/g {} + | |
# rebuild .py because due to updated .ipynb | |
nbdev_build_lib |
# Run this to install kornia | |
!pip install kornia | |
# create a new fastai transform | |
from kornia import rgb_to_grayscale | |
class RGB2GreyTransform(DisplayedTransform): | |
order = 15 # run after IntToFloatTransform | |
def encodes(self, o:TensorImage): | |
# expand restores tensor shape back to use c channels |