Skip to content

Instantly share code, notes, and snippets.

Avatar

Shital Shah sytelus

View GitHub Profile
@cwillmor
cwillmor / ells.pde
Created Jan 25, 2021
ells.pde (L-tiling clock in processing)
View ells.pde
// ell clock https://twitter.com/cwillmore/status/1353435612636803073
// developed with processing 3.5.4 (processing.org)
// TODO:
// - motion blur
// - ripple update of ells - one only starts rotating when it has room to (<< ... <> ... >>)
static final int DEPTH = 3;
static final int N = 1 << (DEPTH + 1);
static final int FRAME_RATE = 30;
static final float DT = 1 / (float)FRAME_RATE;
@tamuhey
tamuhey / tokenizations_post.md
Last active Jun 26, 2022
How to calculate the alignment between BERT and spaCy tokens effectively and robustly
View tokenizations_post.md

How to calculate the alignment between BERT and spaCy tokens effectively and robustly

image

site: https://tamuhey.github.io/tokenizations/

Natural Language Processing (NLP) has made great progress in recent years because of neural networks, which allows us to solve various tasks with end-to-end architecture. However, many NLP systems still require language-specific pre- and post-processing, especially in tokenizations. In this article, I describe an algorithm that simplifies calculating correspondence between tokens (e.g. BERT vs. spaCy), one such process. And I introduce Python and Rust libraries that implement this algorithm. Here are the library and the demo site links:

View LetsDestroyC.md

Let's Destroy C

I have a pet project I work on, every now and then. CNoEvil.

The concept is simple enough.

What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?


@thomwolf
thomwolf / gpt-2-wikitext-103.py
Last active Apr 21, 2022
A very small and self-contained gist to train a GPT-2 transformer model on wikitext-103
View gpt-2-wikitext-103.py
# Copyright (c) 2019-present, Thomas Wolf.
# All rights reserved. This source code is licensed under the MIT-style license.
""" A very small and self-contained gist to train a GPT-2 transformer model on wikitext-103 """
import os
from collections import namedtuple
from tqdm import tqdm
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from ignite.engine import Engine, Events
@rxwei
rxwei / ad-manifesto.md
Last active Nov 4, 2019
First-Class Automatic Differentiation in Swift: A Manifesto
@soumith
soumith / gist:01da3874bf014d8a8c53406c2b95d56b
Last active Mar 28, 2022
Install PillowSIMD+libjpeg-turbo on Conda
View gist:01da3874bf014d8a8c53406c2b95d56b
conda uninstall --force pillow -y
# install libjpeg-turbo to $HOME/turbojpeg
git clone https://github.com/libjpeg-turbo/libjpeg-turbo
pushd libjpeg-turbo
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=$HOME/turbojpeg
make
make install
@ctmakro
ctmakro / ipython_display.py
Last active Apr 12, 2022
Display numpy ndarray as Image in Jupyter/IPython notebook
View ipython_display.py
# if input image is in range 0..1, please first multiply img by 255
# assume image is ndarray of shape [height, width, channels] where channels can be 1, 3 or 4
def imshow(img):
import cv2
import IPython
_,ret = cv2.imencode('.jpg', img)
i = IPython.display.Image(data=ret)
IPython.display.display(i)
View conky-setup-clevo-p751dm2-g.md

Setting up Conky on Ubuntu 16.04LTS for the Clevo P751DM2-G

System Information:

We extract this with inxi:

installation:

sudo apt-get install inxi
@terabyte
terabyte / amazon.md
Created Dec 6, 2017
Amazon's Build System
View amazon.md

Prologue

I wrote this answer on stackexchange, here: https://stackoverflow.com/posts/12597919/

It was wrongly deleted for containing "proprietary information" years later. I think that's bullshit so I am posting it here. Come at me.

The Question

Amazon is a SOA system with 100s of services (or so says Amazon Chief Technology Officer Werner Vogels). How do they handle build and release?

@wassname
wassname / live_plot_notebook.py
Created Sep 27, 2017
Live plot using %matplotlib notebook in jupyter notebook
View live_plot_notebook.py
import numpy as np
from matplotlib import pyplot as plt
class LivePlotNotebook(object):
"""
Live plot using %matplotlib notebook in jupyter notebook
Usage:
```
import time