# ignore files whose suffix is .o or .a
*.[oa]
# you can negate a pattern by starting it with an exclation point(!)
!hello.o
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 torch | |
import torchvision | |
import torch.utils.data | |
from torch.backends import cudnn | |
from torchvision import transforms | |
# some hyperparameters setting | |
use_gpu = True | |
train_batch_size = 64 | |
val_batch_size = 64 |
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
#!/usr/bin/env python | |
import argparse | |
parser = argparse.ArgumentParser( | |
description='Some description about this script', | |
formatter_class=argparse.ArgumentDefaultsHelpFormatter, # show default value | |
) | |
# add required option. Note: required option can't with default parameter | |
parser.add_argument('info', type=str, help="required option") |
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 matplotlib.pyplot as plt | |
import numpy as np | |
import PIL | |
def show_images(images, rows = 1, titles = None): | |
"""Display a list of images in a single figure with matplotlib. | |
Parameters | |
--------- | |
images: List of np.arrays compatible with plt.imshow. |
NewerOlder