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
diff --git a/src/core/lib/gpr/log_linux.cc b/src/core/lib/gpr/log_linux.cc | |
index 561276f0c2..1af0935e1f 100644 | |
--- a/src/core/lib/gpr/log_linux.cc | |
+++ b/src/core/lib/gpr/log_linux.cc | |
@@ -40,7 +40,7 @@ | |
#include <time.h> | |
#include <unistd.h> | |
-static long gettid(void) { return syscall(__NR_gettid); } | |
+static long sys_gettid(void) { return syscall(__NR_sys_gettid); } |
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/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 | |
''' | |
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
import numpy as np | |
def get_1cycle_schedule(lr_max=1e-3, n_data_points=8000, epochs=200, batch_size=40, verbose=0): | |
""" | |
Creates a look-up table of learning rates for 1cycle schedule with cosine annealing | |
See @sgugger's & @jeremyhoward's code in fastai library: https://github.com/fastai/fastai/blob/master/fastai/train.py | |
Wrote this to use with my Keras and (non-fastai-)PyTorch codes. | |
Note that in Keras, the LearningRateScheduler callback (https://keras.io/callbacks/#learningratescheduler) only operates once per epoch, not per batch | |
So see below for Keras callback | |
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 | |
# Replaces lengthy words/phrases with shorter variants | |
# Author: Scott Hawley | |
import pandas as pd | |
import re | |
import os |
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
import numpy as np | |
import cv2 | |
import soundcard as sc # Get it from https://github.com/bastibe/SoundCard | |
imWidth, imHeight = 1024, 512 # screen size | |
def draw_wave(screen, mono_audio, xs, title="oscilloscope", gain=5): | |
screen *= 0 # clear the screen | |
ys = imHeight/2*(1 - np.clip( gain * mono_audio[0:len(xs)], -1, 1)) # the y-values of the waveform | |
pts = np.array(list(zip(xs,ys))).astype(np.int) # pair up xs & ys | |
cv2.polylines(screen,[pts],False,(0,255,0)) # connect points w/ lines | |
cv2.imshow(title, screen) # show what we've got |
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
import pysox | |
import librosa | |
import numpy as np | |
def apply_sox_effect(signal, sr, fxstr): | |
# This writes signal to a .wav file, processes it sox to another file, loads that and returns it. | |
# | |
# signal: a numpy list of numbers; the audio signal | |
# sr: the sample rate in Hz, must be an integer | |
# fxstr: a semicolon-separated string starting with the effect name followed by parameter values in order |