Skip to content

Instantly share code, notes, and snippets.

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 5, 2024 22:16
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@ikonst
ikonst / cfdata.py
Last active January 27, 2024 22:18
LLDB extension for saving CFData to local file; useful for remote iOS debugging
'''
INSTALLING
curl --create-dirs -o ~/.lldb/cfdata.py https://gist.githubusercontent.com/ikonst/364af37c44e5f549b722/raw/cfdata.py \
&& echo 'command script import ~/.lldb/cfdata.py' >> ~/.lldbinit
USING
(lldb) cfdata_save some_cfdata /Users/john/foo
(lldb) cfdata_save some_nsdata /Users/john/bar
@nadavrot
nadavrot / Matrix.md
Last active July 1, 2024 17:31
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@galloscript
galloscript / FObjectPool.h
Last active January 26, 2019 10:48
C++ Raw Pool and Object Pool Implementation in my Sandbox Library
/*
* @file FObjectPool.h
* @author David Gallardo Moreno
*/
#ifndef __SBX_OBJECT_POOL_H__
#define __SBX_OBJECT_POOL_H__
#include <Library/FRawPool.h>

Hello,

When you look at a repo, be sure to use git log --all and look at the latest commits across all branches. You would see that my work is on the "dec6" branch, not the main branch.

In general, it's more reliable to DM me on twitter than to email me. I'll usually respond within a day. Emails are hit-or-miss.

Here is the critical difference:

@NeatMonster
NeatMonster / README.md
Last active April 23, 2024 09:23
A simple hexdump module for Python

Simple Hexdump

A simple hexdump module for Python.

Installation

The preferred installation method is:

pip install simple-hexdump
@nmwsharp
nmwsharp / printarr
Last active October 24, 2023 08:06
Pretty print tables summarizing properties of tensor arrays in numpy, pytorch, jax, etc. --- now on pip: `pip install arrgh`
Pretty print tables summarizing properties of tensor arrays in numpy, pytorch, jax, etc.
Now on pip! `pip install arrgh` https://github.com/nmwsharp/arrgh

Reinforcement Learning for Language Models

Yoav Goldberg, April 2023.

Why RL?

With the release of the ChatGPT model and followup large language models (LLMs), there was a lot of discussion of the importance of "RLHF training", that is, "reinforcement learning from human feedback". I was puzzled for a while as to why RL (Reinforcement Learning) is better than learning from demonstrations (a.k.a supervised learning) for training language models. Shouldn't learning from demonstrations (or, in language model terminology "instruction fine tuning", learning to immitate human written answers) be sufficient? I came up with a theoretical argument that was somewhat convincing. But I came to realize there is an additional argumment which not only supports the case of RL training, but also requires it, in particular for models like ChatGPT. This additional argument is spelled out in (the first half of) a talk by John Schulman from OpenAI. This post pretty much