Skip to content

Instantly share code, notes, and snippets.

View iraquitan's full-sized avatar

Iraquitan Cordeiro Filho iraquitan

View GitHub Profile
import torch
from custom_dataset_pytorch import CustomDataset
dataset = CustomDataset(root="my-dataset/train")
# Defines a loader that will sample shuffled data in batches of 4
dataloader = torch.utils.data.DataLoader(dataset, batch_size=4, shuffle=True, num_workers=2)
for i_batch, sample_batched in enumerate(dataloader, 0):
from pathlib import Path
import torch
from torch.utils.data import Dataset
class CustomDataset(Dataset):
def __init__(self, root, transform=None, target_transform=None,):
self.root = Path(root)
data_path = self.root / "data.pt"
labels_path = self.root / "labels.pt"
if not data_path.exists():
@iraquitan
iraquitan / vscode-styles.css
Last active June 4, 2018 03:17
Visual Studio Code Custom CSS and JS Styles
/*
I decided on the Brush Script MT cursive font for now. Works better for me than FlottFlott.
*/
/* .mtk7,
.mtk3,
.mtk13,
.mtk16 {
margin-left: 1px;
font-family: "Operator Mono";
font-size: 1.7em;
# gist to sync atom settings
@iraquitan
iraquitan / django-setup-mac
Created July 8, 2016 11:40
Install Django and setup project and app setup
# install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install python or python3
pip install python
pip install python3
# install virtualenv
pip install virtualenv
pip3 install virtualenv
@iraquitan
iraquitan / mac-brew-python3-postgresql-psycopg2
Created July 7, 2016 14:52
PostgreSQL and psycopg2 initial setup on Mac with Homebrew and Python 3
# install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install postgresql
brew install postgresql
# start homebrew postgresql service
brew service start postgresql
# create a database with your username

Keybase proof

I hereby claim:

  • I am iraquitan on github.
  • I am iraquitan (https://keybase.io/iraquitan) on keybase.
  • I have a public key ASDnFtEKACApMKdi07cBWLtYVOxosHN1gT58wh811CSjsgo

To claim this, I am signing this object: