Skip to content

Instantly share code, notes, and snippets.

View jlertle's full-sized avatar

Jason Lee Ertle jlertle

  • Saint Petersburg, FL, US
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iani
iani / BresenhamEuclidean_SuperCollider.scd
Last active January 18, 2021 12:28
Bresenham Implementation of the Euclidean Rhythm Algorithm in SuperCollider
/* Sources:
See: https://codepen.io/Dafuseder/pen/WEqOVw
https://gist.github.com/crashingbooth/e9f0b7dbec8aecabf13db3663d28480f
https://medium.com/code-music-noise/euclidean-rhythms-391d879494df
*/
//:Implementation 1 (plain)
(
~br = { | o = 1, p = 4 |
(o / p * (0..p - 1)).floor.differentiate.asInteger.put(0, 1);
};
@charlesbmi
charlesbmi / deepkoopman.ipynb
Last active August 18, 2023 00:59
Tensorflow 2 / Keras re-implementation of DeepKoopman. DeepKoopman is described in " Deep learning for universal linear embeddings of nonlinear dynamics"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sergeyprokudin
sergeyprokudin / keras_prob_dnn.py
Last active February 22, 2022 17:36
Simple Keras DNN with probabilistic Gaussian output (mean + variance)
import numpy as np
from keras.layers import Input, Dense
from keras.models import Model, Sequential
def dnn(n_inputs, n_outputs, n_hidden_layers=3, hlayer_size=128, probabilistic=True):
"""Defines simple DNN model
"""
x_input = Input(shape=[n_inputs])
@saravanabalagi
saravanabalagi / tf2_tracing_estimators.md
Created January 16, 2020 11:20
Profiling Tensorflow Estimator in tf2

Based on Summary Trace API,

device_name = tf.test.gpu_device_name()
if not tf.test.is_gpu_available():
    raise SystemError('GPU device not found')
print('Found GPU at: {}'.format(device_name))
os.makedirs(os.path.join(args.exp_dir, 'plugins/profile'), exist_ok=True)
tf.summary.trace_on(graph=True, profiler=True)
tracing_params = params.copy()
@jrapoport
jrapoport / different-ssh-deploy-keys-multiple-private-repos-github-go-mod.md
Last active March 17, 2025 15:29
How to use different ssh deploy keys for multiple private github repositories with Golang Modules (go mod)

How to use different ssh deploy keys for multiple private github repositories with Go Modules

Let's assume you are using Go Modules and have a go.mod file that contains multiple private repos each with a different ssh key. How can you get go mod download to do the right thing -- i.e. use ssh key A with private repo A and ssh key B with private repo B?

Ok, here we go!

Let's assume you have some github.com user with multiple private repos:

https://github.com/someuser/private-repo-1

@ines
ines / Install
Last active September 21, 2023 17:14
Streamlit + spaCy
pip install streamlit
pip install spacy
python -m spacy download en_core_web_sm
python -m spacy download en_core_web_md
python -m spacy download de_core_news_sm
@sergeyprokudin
sergeyprokudin / gauss_neg_loglikelihood_keras.py
Last active January 18, 2024 00:58
Multivariate Gaussian Negative LogLikelihood Loss Keras
import keras.backend as K
import numpy as np
def gaussian_nll(ytrue, ypreds):
"""Keras implmementation of multivariate Gaussian negative loglikelihood loss function.
This implementation implies diagonal covariance matrix.
Parameters
----------
@zmjjmz
zmjjmz / sagemaker_multiin_repro.py
Created September 11, 2018 23:28
Sagemaker Multi-input repro
import os
import json
import numpy
import tensorflow
from tensorflow.python.estimator.export.export import build_raw_serving_input_receiver_fn
print("Tensorflow version: {0}".format(tensorflow.VERSION))
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
@kstrauser
kstrauser / black.md
Last active March 18, 2023 00:24
Using the "black" Python formatter in VS Code

This is how to use the Black Python code formatter in VS Code.

Make a Python 3.6 virtualenv for running Black

Black itself requires Python 3.6 to run, but few of our projects are on that version. The VS Code plugin conveniently lets you run black from its own virtualenv.

I had to give a specific version of black this morning. I didn't yesterday. Don't specify the version unless it makes you (and if you do, give the current version, not the one from this doc).

$ cd ~/Envs