Some notes on AI Agent Rule / Instruction / Context files / etc.
This file contains hidden or 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
| ### JHW 2018 | |
| import numpy as np | |
| import umap | |
| # This code from the excellent module at: | |
| # https://stackoverflow.com/questions/4643647/fast-prime-factorization-module | |
| import random |
This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.
While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.
This file contains hidden or 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
| from __future__ import with_statement | |
| from alembic import context | |
| from sqlalchemy import engine_from_config, pool | |
| from logging.config import fileConfig | |
| from models import Base | |
| config = context.config | |
| fileConfig(config.config_file_name) |
This file contains hidden or 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
| """ | |
| A bare bones examples of optimizing a black-box function (f) using | |
| Natural Evolution Strategies (NES), where the parameter distribution is a | |
| gaussian of fixed standard deviation. | |
| """ | |
| import numpy as np | |
| np.random.seed(0) | |
| # the function we want to optimize |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| """ Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """ | |
| import numpy as np | |
| import cPickle as pickle | |
| import gym | |
| # hyperparameters | |
| H = 200 # number of hidden layer neurons | |
| batch_size = 10 # every how many episodes to do a param update? | |
| learning_rate = 1e-4 | |
| gamma = 0.99 # discount factor for reward |
This file contains hidden or 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
| FROM python:2.7-alpine | |
| MAINTAINER Nick Janetakis <nick.janetakis@gmail.com> | |
| ENV INSTALL_PATH /bsawf | |
| RUN mkdir -p $INSTALL_PATH | |
| WORKDIR $INSTALL_PATH | |
| COPY requirements.txt requirements.txt | |
| RUN apk add --no-cache --virtual .build-deps \ |
This file contains hidden or 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
| # La Primavera (Vivaldi) | |
| # Scale: Just Intornation | |
| # E major (E=1, B=3/2, Gs=5/4, Fs=9/8, Ds=15/8, A=4/3, Cs=5/3) | |
| def mult(n, m) | |
| hz_to_midi(midi_to_hz(n) * m) | |
| end | |
| #jE5 = mult(:A5, 3.0/4) | |
| jE5 = mult(:C5, 5.0/4) | |
| jiscale = { |
NewerOlder