Skip to content

Instantly share code, notes, and snippets.

@jakelevi1996
Last active February 17, 2020 17:05
Show Gist options
  • Save jakelevi1996/7e63bc8ea9e0abb8e8b0a58395ab31d0 to your computer and use it in GitHub Desktop.
Save jakelevi1996/7e63bc8ea9e0abb8e8b0a58395ab31d0 to your computer and use it in GitHub Desktop.
Gist "To do" list

Gist "To do" list

Here is my to-do list for Gists/things I intend to write Gists about:

  • Generic Bayesian linear regression: as basis functions, define some classes with __call__ methods (EG Gaussian, polynomials) which take appropriate parameters to their __init__ method (EG location, scale, polynomial order); a given Bayesian linear regression solution should accept a list of basis functions, whose outputs for each data point can be calculated with the built-in map function, or numpy.vectorise, and compare the output with the MAP and ML solutions, EG:
import numpy as np

class Sigmoid:
    def __init__(self, loc): self.loc = loc
    def __call__(self, x): return 1.0 / (1.0 + np.exp(self.loc - x))

loc_list = np.linspace(0, 1, 10) # 10 basis functions
basis_functions = [Sigmoid(loc) for loc in loc_list]
x = np.linspace(0, 1, 20) # 20 data points
phi = np.array([b(x) for b in basis_functions]) # (10, 20) design matrix
  • Repeat above with Newton's method (+ line-search?) for logistic regression
  • DSP Gists:
    • HMM
    • Kalman filtering
    • Spectrogram (STFT?)
    • PSD tests? See 3F1/3F3 notes
    • Resampling using Fourier methods; try different methods to avoid ringing by applying a function before resampling and then applying the inverse function after resampling, EG:
      • Subtracting a linear-least squares interpolation of the data
      • Subtracting a line which interpolates the first and last data points
      • Multiplying element-wise by a non-zero window which is tapered at the edges (EG Hamming window)
  • Speed tests Gist:
    • Turn the code into a speed_test function, which accepts a test-function as an argument
    • Add an optional warmup time; the warmup time works by initiating a signal.alarm (only after registering a signal-handler) and then running the test function in a loop until the signal.alarm is raised; the signal-handler raises a time-out error which is caught in the loop and sets a flag, which makes the loop exit, at which point the code can go into the rest of the speed_test function
    • Make the speed_test function able to accept multiple test_functions so that it can make a comparison and plot the results on a graph
  • Gist about linked lists in C: add description of why linked lists are useful/when to use them
  • Gist about writing "Hello world" to a file: add 2 alternative approaches using system and execl
  • A single Gist containing the following functions:
    • fork
    • execle
    • strerror(errno)
    • fileno
    • dup2
    • exit
    • waitpid (<sys/wait.h>
  • Preprocessor directives in C
  • Useful GCC compiler flags
  • Basic Java usage
  • Basic threading/multiprocessing/mapping tutorial
  • Basic Docker commands and volumes
  • Writing functions for frequently saving matplotlib.pyplot images
  • Logging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment