Skip to content

Instantly share code, notes, and snippets.

View carlthome's full-sized avatar
🎼

Carl Thomé carlthome

🎼
View GitHub Profile
@kastnerkyle
kastnerkyle / audio_tools.py
Last active June 21, 2024 07:43
Audio tools for numpy/python. Constant work in progress.
raise ValueError("DEPRECATED/FROZEN - see https://github.com/kastnerkyle/tools for the latest")
# License: BSD 3-clause
# Authors: Kyle Kastner
# Harvest, Cheaptrick, D4C, WORLD routines based on MATLAB code from M. Morise
# http://ml.cs.yamanashi.ac.jp/world/english/
# MGC code based on r9y9 (Ryuichi Yamamoto) MelGeneralizedCepstrums.jl
# Pieces also adapted from SPTK
from __future__ import division
import numpy as np
@Nicholas-Swift
Nicholas-Swift / astar.py
Last active May 12, 2024 18:34
A* pathfinding algorithm. Please see comments below for a fork of this gist that includes bug fixes!
class Node():
"""A node class for A* Pathfinding"""
def __init__(self, parent=None, position=None):
self.parent = parent
self.position = position
self.g = 0
self.h = 0
@rickhull
rickhull / configuration.nix
Last active May 31, 2024 20:58
Prometheus, Grafana, Loki, Promtail on NixOS
# MONITORING: services run on loopback interface
# nginx reverse proxy exposes services to network
# - grafana:3010
# - prometheus:3020
# - loki:3030
# - promtail:3031
# prometheus: port 3020 (8020)
#
services.prometheus = {

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

@mxkrn
mxkrn / metaphor-research-digest.py
Last active September 12, 2023 14:17
Metaphor Research Digest Slack App
"""
This script uses the Metaphor (https://metaphor.systems) API to fetch the latest research results for a query of choice.
Given the popularity of Slack as a communication channel, it also provides the option to forward this information
to Slack using a web hook URL.
Usage:
1. Set the environment variables METAPHOR_API_KEY and SLACK_URL
2. Create a python>=3.7 environment
3. Install dependencies: `pip install metaphor-python requests`
4. Run: `python metaphor-research-digest.py --days 7 --num-results 10 --publish-to-slack`