Skip to content

Instantly share code, notes, and snippets.

View tcapelle's full-sized avatar
😄
happy

Thomas Capelle tcapelle

😄
happy
View GitHub Profile
@tcapelle
tcapelle / git.md
Last active June 17, 2019 07:51
Useful commands

Check fiest that a upstream repo is setup here. $ git remote -v Basic commands to sync/merge git with origin.

$ git checkout master
> Switched to branch 'master'

$ git merge upstream/master
> Updating a422352..5fdff0f
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tcapelle
tcapelle / install.md
Last active November 28, 2019 13:34
Installing bifacial Radiance

Quick install :

  1. Installer Radiance et ajouter les binaires au Path de windows. Faire un test simple, ouvrir une terminal (je conseil cmder) et lance la commande:
>>rvu
rvu: fatal - missing octree argument

L'output doit etre rvu: fatal - missing octree argument, ca veut dire que il trouve rvu sur ton path.

  1. Créer un environment sur conda pour travailler sur Radiance
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Basic Linux Setup

This gist aims to setup a LInux machine for python work from scratch.

ZSH

Other terminal app that is plain better.

TMUX

  • start new with session name: tmux new -s myname
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def _get_col_idxs(df, cols):
"return cols index to perform iloc"
return [df.columns.get_loc(c) for c in L(cols) if c in df]
def _iloc(df, rows, cols=None):
"Iloc that supports col names"
if isinstance(cols, (tuple, list, str)):
cols = _get_col_idxs(df, cols)
return df.iloc[rows, cols]
return df.iloc[rows, slice(None)]
@tcapelle
tcapelle / seg_mixer.py
Last active September 7, 2021 12:32
A segmentation model using an MLP mixer. Code from @lucidrains
from torch import nn
from functools import partial
from einops.layers.torch import Rearrange, Reduce
class PreNormResidual(nn.Module):
def __init__(self, dim, fn):
super().__init__()
self.fn = fn
self.norm = nn.LayerNorm(dim)
@tcapelle
tcapelle / intro.md
Last active December 8, 2021 14:38
Running the benchmark on your Nvidia equipped laptop

Setup NGC Docker

you will need to setup docker with nvidia runtime, containers

  • Install docker and nvidia-docker:
sudo apt-get install -y docker nvidia-container-toolkit
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.