Skip to content

Instantly share code, notes, and snippets.

View brannondorsey's full-sized avatar
📡
Makin' the net work

Brannon Dorsey brannondorsey

📡
Makin' the net work
View GitHub Profile
@brannondorsey
brannondorsey / log.py
Last active May 10, 2017 17:15
Simply Python Logger
# Copyright (c) 2017 Brannon Dorsey
# 2017 Branger Briz, Inc
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
@brannondorsey
brannondorsey / ml4music-quickstart.md
Created April 23, 2017 15:22
Quick start guide for the ml4music-workshop

ml4music workshop quickstart

  1. Download and install Docker: MacOS | Windows | Linux
  2. Clone the ml4music-workshop repo
git clone https://github.com/brannondorsey/ml4music-workshop
  1. Attach to the workshop docker container
cd ml4music-workshop
@brannondorsey
brannondorsey / getSelected.js
Last active March 8, 2017 00:33
Get the selected data in Tensorboard embedding projector to the dev console
// copy and paste the following snippet into the developer's console
function getSelected() {
query_selector = '.label.style-scope.vz-projector-inspector-panel.style'
+ '-scope.vz-projector-inspector-panel.style-scope.vz-projector'
+ '-inspector-panel.style-scope.vz-projector-inspector-panel'
items = document.querySelectorAll(query_selector)
names = []
items.forEach(item => {
if (item.childNodes[0].textContent) {
@brannondorsey
brannondorsey / deep_q_learning_notes.md
Created December 13, 2016 19:04
Notes from Tambet Mattisen's Demistifying Deep Reinforcement Learning article

Deep Reinforcement Learning

Notes from Tambet Mattisen's Demistifying Deep Reinforcement Learning article.

  • Reinforcement learning is somewhat in-between supervised and unsupervised learning.
  • In reinforcement learning one has sparse and time-delayed labels – the rewards.
  • Credit assignment problem – i.e., which of the preceding actions was responsible for getting the reward and to what extent.
  • Explore-exploit dilemma – should you exploit the known working strategy or explore other, possibly better strategies.

Markov Decision Process

Creating Input Frames from a Video

First create an image sequence from a video with:

ffmpeg -i path/to/video.mp4 -r 30 path/to/output/folder/%06d.png

Where -r specifies the frequency to save an image (in Hz, i.e. 30 == 30fps) and %06d.png creates a zero-padded filename with 6 zeros.

Next images must be scaled and cropped. For my original case, I need to generate new images based on 512x512 input images, so I will crop a greedy (720x720) square out of a 1280x720 video in the direct center and then scale to 512x512. mogrify, unlike convert, edits images in place without creating copies :)

@brannondorsey
brannondorsey / pix2pix_paper_notes.md
Last active January 3, 2022 09:57
Notes on the Pix2Pix (pixel-level image-to-image translation) Arxiv paper

Image-to-Image Translation with Conditional Adversarial Networks

Notes from arXiv:1611.07004v1 [cs.CV] 21 Nov 2016

  • Euclidean distance between predicted and ground truth pixels is not a good method of judging similarity because it yields blurry images.
  • GANs learn a loss function rather than using an existing one.
  • GANs learn a loss that tries to classify if the output image is real or fake, while simultaneously training a generative model to minimize this loss.
  • Conditional GANs (cGANs) learn a mapping from observed image x and random noise vector z to y: y = f(x, z)
  • The generator G is trained to produce outputs that cannot be distinguished from "real" images by an adversarially trained discrimintor, D which is trained to do as well as possible at detecting the generator's "fakes".
  • The discriminator D, learns to classify between real and synthesized pairs. The generator learns to fool the discriminator.
  • Unlike an unconditional GAN, both th

Keybase proof

I hereby claim:

  • I am brannondorsey on github.
  • I am brannondorsey (https://keybase.io/brannondorsey) on keybase.
  • I have a public key whose fingerprint is 1A0F 6E80 D1CC 2F45 6EB9 1FD7 8E0D 2D73 A603 FE9A

To claim this, I am signing this object:

@brannondorsey
brannondorsey / sch_ml_research.md
Last active November 14, 2016 23:25
Research into using machine learning to generate .sch files.

Procuring large schematic dataset

Use GitHub API to batch download .sch files.

  1. GitHub API requires you to limit searches to users, orgs, or repos. So we first have to get a list of repos that use the KiCad or EAGLE "languages".
https://api.github.com/search/repositories?q=language:kicad&per_page=100&page=1
https://api.github.com/search/repositories?q=language:eagle&per_page=100&page=1

#Making Persistent Live USBs is Harder Than it Should Be 9/14/2016

What used to be easy with Ubuntu's Starup Disk Creator (usb-creator-common + usb-creator-gtk) is now a lot harder than it should be on UEFI systems. Some version before v0.2.66 have a bug that allows you to specify live usb persistence, however it doesn't actually work. Versions > 0.3 have removed this functionality completely (wtf!).

An alternative that worked for me was using mkusb from an installed Ubuntu distro (I could not get this to work creating live USBs from live USBs).

Steps on Ubuntu 16.06 include:

@brannondorsey
brannondorsey / of_gitignore.txt
Created May 5, 2016 05:48
OpenFrameworks Project .gitignore
###########################
# ignore generated binaries
# but not the data folder
###########################
*/bin/*
!*/bin/data/
#########
# general