Skip to content

Instantly share code, notes, and snippets.

@djhocking
djhocking / dplyr-select-names.R
Last active February 28, 2022 19:08
Select columns by vector of names using dplyr
one <- seq(1:10)
two <- rnorm(10)
three <- runif(10, 1, 2)
four <- -10:-1
df <- data.frame(one, two, three)
df2 <- data.frame(one, two, three, four)
str(df)
@robertsdionne
robertsdionne / deepdream-install.md
Last active March 18, 2026 23:00
Deepdream installation
#!/usr/bin/env bash

# Assuming OS X Yosemite 10.10.4

# Install XCode and command line tools
# See https://itunes.apple.com/us/app/xcode/id497799835?mt=12#
# See https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcode-select.1.html
xcode-select --install

Horizons in Probabilistic Programming and Bayesian Analysis

Representations:

  • Hierarchical models
  • Hidden Markov models
  • Graphical models
  • Non-parametric Bayes (distributions over functions)

Inference Approaches:

@TomAugspurger
TomAugspurger / var.ipynb
Last active July 19, 2022 05:46
Logistic regression prediction interval
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@genekogan
genekogan / _Instructions.md
Last active September 21, 2024 10:33
instructions for generating a style transfer animation from a video

Instructions for making a Neural-Style movie

The following instructions are for creating your own animations using the style transfer technique described by Gatys, Ecker, and Bethge, and implemented by Justin Johnson. To see an example of such an animation, see this video of Alice in Wonderland re-styled by 17 paintings.

Setting up the environment

The easiest way to set up the environment is to simply load Samim's a pre-built Terminal.com snap or use another cloud service like Amazon EC2. Unfortunately the g2.2xlarge GPU instances cost $0.99 per hour, and depending on parameters selected, it may take 10-15 minutes to produce a 512px-wide image, so it can cost $2-3 to generate 1 sec of video at 12fps.

If you do load the

@dave-andersen
dave-andersen / kmeans.py
Last active September 1, 2022 11:15
k-means in Tensorflow
import tensorflow as tf
import numpy as np
import time
N=10000
K=4
MAX_ITERS = 1000
start = time.time()
@cjw85
cjw85 / keras_call.py
Created June 21, 2017 16:06
Implementation of nanonet using keras.
"""
Reimplementation of nanonet using keras.
Follow the instructions at
https://www.tensorflow.org/install/install_linux
to setup an NVIDIA GPU with CUDA8.0 and cuDNN v5.1.
virtualenv venv --python=python3
. venv/bin/activate
pip install numpy
@sbalnojan
sbalnojan / fit_dump_model_to_s3fs.py
Created May 22, 2019 12:02
Fit model, dump to S3 via s3fs
import s3fs
import pickle
import json
import numpy as np
BUCKET_NAME = "my-bucket"
# definitions, keras/tf/... imports...
if __name__ == "__main__":
# launch your own Gradio Web Demo of Arcane style transfer by following the steps below
# open a jupyter notebook, code editor (vs code etc), or google colab
# pip install gradio
# copy the code below into a file or cell in a python notebook and run it
# that's it, a web demo will appear in your python notebook or web browser
# github: https://github.com/jjeamin/anime_style_transfer_pytorch
# HF blog: https://huggingface.co/blog/gradio-spaces
import gradio as gr