Skip to content

Instantly share code, notes, and snippets.

Avatar

Ruotian(RT) Luo ruotianluo

View GitHub Profile
@ruotianluo
ruotianluo / find_ipad_slot.py
Created Jul 6, 2021
find_ipad_slot(pick up)
View find_ipad_slot.py
# Find spot.
from bs4 import BeautifulSoup
import requests
import json
# change accordingly.
postal_code = '60615'
def find_spot():
headers = {
View gist:c7e1a6b424fe4adbcedf6dcab4b80ded
import torch
import torch.nn as nn
class involution(torch.nn.Module):
def __init__(self):
super().__init__()
self.K = K = 3
self.C = C = 256
self.r = r = 64
self.G = G = 64
View gist:54c25460b2ca43a274f50e1a7daa409a
import torch
import torch.nn as nn
class X(nn.Module):
def __init__(self):
super().__init__()
self.a = nn.Linear(3,4)
def forward(self, x):
x = next(self.parameters())
import torchvision
View test_dist.py
import os
import tempfile
import torch
import torch.distributed as dist
import torch.nn as nn
import torch.optim as optim
import torch.multiprocessing as mp
from torch.nn.parallel import DistributedDataParallel as DDP
View train_cityscapes2.py
import torch
import torch.multiprocessing as mp
import torch.distributed as dist
from torchvision import transforms
import random
from functools import partial
from easydict import EasyDict as edict
from albumentations import (
Compose, HorizontalFlip, ShiftScaleRotate, PadIfNeeded, RandomCrop,
RGBShift, RandomBrightness, RandomContrast
View train_cityscapes2.py
import torch
import torch.multiprocessing as mp
import torch.distributed as dist
from torchvision import transforms
import random
from functools import partial
from easydict import EasyDict as edict
from albumentations import (
Compose, HorizontalFlip, ShiftScaleRotate, PadIfNeeded, RandomCrop,
RGBShift, RandomBrightness, RandomContrast
View train_cityscapes2.py
import torch
import torch.multiprocessing as mp
import torch.distributed as dist
from torchvision import transforms
import random
from functools import partial
from easydict import EasyDict as edict
from albumentations import (
Compose, HorizontalFlip, ShiftScaleRotate, PadIfNeeded, RandomCrop,
RGBShift, RandomBrightness, RandomContrast
View cached_transformer.py
# This file contains Transformer network
# Most of the code is copied from http://nlp.seas.harvard.edu/2018/04/03/attention.html
# The cfg name correspondance:
# N=num_layers
# d_model=input_encoding_size
# d_ff=rnn_size
# h is always 8
from __future__ import absolute_import
@ruotianluo
ruotianluo / Detectron.pytorch_pth1_patch.diff
Created Feb 10, 2019
Pytorch 1.0 patch for Detectron.pytorch
View Detectron.pytorch_pth1_patch.diff
This file has been truncated, but you can view the full file.
From 784c05a1ca663d88d68a644108ad2514b79310dc Mon Sep 17 00:00:00 2001
From: adityaarun1 <adityaarun1@gmail.com>
Date: Wed, 16 Jan 2019 22:15:26 +0530
Subject: [PATCH] migrating to Pytorch-1.0
---
.gitignore | 2 +
README.md | 13 +-
lib/make.sh | 56 +-
@ruotianluo
ruotianluo / test_roialign.py
Created Oct 6, 2017
A snippet to show how roialign works
View test_roialign.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np