This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
# Uses temporal difference policy method | |
# See, e.g., http://www.cs.dartmouth.edu/~lorenzo/teaching/cs134/Archive/Spring2009/final/PengTao/final_report.pdf | |
# In this code, X plays randomly whereas O 'learns'. (Feel free to change that) | |
# Thus we expect O to outperform X eventually | |
# Author: Scott Hawley http://drscotthawley.github.io | |
# Unlimited License: Feel free to use any or all of this code however you like. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
__author__ = 'Scott H. Hawley' | |
__copyright__ = 'Scott H. Hawley' | |
__license__ = "MIT Licence (do what you want, don't blame me)" | |
import numpy as np | |
import cv2 | |
import soundcard as sc # https://github.com/bastibe/SoundCard | |
from scipy.ndimage.interpolation import shift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
''' | |
osc2wek.py | |
Author: Scott Hawley | |
This listens for incoming OSC messages and sends them on to Wekinator | |
Steps to get running (in Terminal): | |
0. First you need Mercurial "hg". It might be installed by default. | |
1. Use hg to clone the grail osc code: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/env/python3 | |
# | |
# FMA conversion script, genre classification | |
# Author: Scott Hawley | |
# License: Do as you like | |
# | |
# For FMA dataset https://github.com/mdeff/fma | |
# to be used with panotti https://github.com/drscotthawley/panotti | |
# | |
# This will create a directory called Samples/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
# Test script for Phase 'Unrolling' / Instantaneous frequency | |
# | |
# See Jesse Engel's "rainbowgrams" script, https://gist.github.com/jesseengel/e223622e255bd5b8c9130407397a0494 | |
# | |
# Modifications by Scott H. Hawley, @drscotthawley and Billy Mitchell | |
# These modified versions seem to be both more accurate (~2000x less reconstruction error) | |
# and faster (>20%) | |
# | |
# note, to really see/hear the difference, change dtypes to np.float16! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# Little script I use to start a new Markdown blog entry. | |
# Run from the parent directory above the blog directory, | |
# or supply a full path to run from anywhere. | |
# | |
# Usage: newpost.py <title> | |
# It automatically figures out what the current date is to | |
# create a new entry, and supplies a default header with a title | |
# and a bibliography placement |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
''' | |
Simulation of a 'magnetic' pendulum. Actually we'll just use | |
electrostatic charges instead of magnets, but..good enough, right? | |
Plots an image showing which source the object is closest to after a certain time | |
(Note: Depending on params like maxiter, the object may still be moving at the | |
end of the simulation, so the 'ending position' may not be where it comes to rest.) | |
This code integrates all the (non-interacting) test objects at once, on the GPU. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Replaces lengthy words/phrases with shorter variants | |
# Author: Scott Hawley | |
import pandas as pd | |
import re | |
import os |
OlderNewer