Skip to content

Instantly share code, notes, and snippets.

View schlerp's full-sized avatar

PattyC schlerp

View GitHub Profile
@schlerp
schlerp / sleepdemoserial.c
Last active August 29, 2015 14:11 — forked from ecerulm/sleepdemoserial.c
edited code from ecrelum to add ability to read all defined sensors once if an 'R' comes in the serial
/* Sleep Demo Serial
* -----------------
* Example code to demonstrate the sleep functions in a Arduino. Arduino will wake up
* when new data is received in the serial port USART
* Based on Sleep Demo Serial from http://www.arduino.cc/playground/Learning/ArduinoSleepCode
*
* Copyright (C) 2006 MacSimski 2006-12-30
* Copyright (C) 2007 D. Cuartielles 2007-07-08 - Mexico DF
*
* With modifications from Ruben Laguna 2008-10-15
// Pin 13 has an LED connected on most Arduino boards.
// Pin 11 has the LED on Teensy 2.0
// Pin 6 has the LED on Teensy++ 2.0
// Pin 13 has the LED on Teensy 3.0
// give it a name:
int led = 13;
// set up morse code timeings...
int base_time = 100; // 200 ms base speed ~ 24 wpm
void setup () {
// do what ever to get it all set up
// only ran once at poweron
}
void main () {
if (sensorpin is low && analogread value less than x) {
set pin high
}
from __future__ import absolute_import, division, print_function
import os
import pickle
from six.moves import urllib
import tflearn
from tflearn.data_utils import *
path = "data/sherlock_edited.txt"
This file has been truncated, but you can view the full file.
A STUDY IN SCARLET
Table of contents
Part I
Mr. Sherlock Holmes
The Science Of Deduction
The Lauriston Garden Mystery
What John Rance Had To Tell
Our Advertisement Brings A Visitor
'''
ga_tfl.py
applying genetic algorithms to TFLearn neural networks
'''
import random
import tflearn
from tflearn.data_utils import *
@schlerp
schlerp / ga_backprop_nn.py
Created September 21, 2017 05:46
using back propagation and genetic algorithm's to train a simple neural network :)
import numpy as np
import itertools
import random
# set up hyper params
pop_size = 10
learn_rate = 3
epochs = 500
train_epochs = 25
import os
from hl7apy.parser import parse_message
input_folder_prod = ''
input_folder_test = ''
def get_fnames(folder):
ret = []
@schlerp
schlerp / engine.py
Created January 11, 2018 06:30
game engine
import time
import pygame
from pygame.locals import *
'''
brainstorm:
level: collection of maps
game: collection of levels
@schlerp
schlerp / cnn_blocks.py
Created February 2, 2018 01:00
some of the inception v3 and v4 blocks implemented in TFLearn. I hope this helps someone!
import tflearn
from tflearn.layers.conv import conv_2d, max_pool_2d, avg_pool_2d
from tflearn.layers.merge_ops import merge
from tflearn.layers.normalization import local_response_normalization
def inceptionv3_block(input_block, filter_width=1, stride=1,
activation='relu', regularizer='L2', normalise=False):
# 1x1 convolutions