Skip to content

Instantly share code, notes, and snippets.

View iandanforth's full-sized avatar

Ian Danforth iandanforth

View GitHub Profile
@iandanforth
iandanforth / GoalDirectedSensoryMotorLearning
Last active August 29, 2015 13:57
Thoughts on how Goals are associated with, and eventually drive behavior.
There is almost always a goal
A goal needs to be able to *start* or *modify* behavior.
The spatial representation is a concatenation of senses and intended movement
At some level that combination needs to be represented uniquely. Aka few enough possibilities to represent them all.
When a goal is achieved the behavior that led to it needs to be reinforced.
@iandanforth
iandanforth / getMacModel.py
Last active December 31, 2015 13:09
A python method to get the mac model of the current machine.
import subprocess
def getMacModel():
'''
Returns the Model Identifier for the current machine.
'''
cmd = "sysctl -n hw.model"
cmdOut = subprocess.check_output(cmd, shell=True)
@iandanforth
iandanforth / externalPIDControl.py
Created October 27, 2013 17:07
An exploration of PID control external to that provided by the AX-12 Dynamixel servo.
#!/usr/bin/env python
import os
import dynamixel
import time
import sys
import subprocess
import optparse
import yaml
@iandanforth
iandanforth / smg_boto_get_data.py
Created October 1, 2013 19:13
Updated, smugmug specific boto data collection script.
#-------------------------------------------------------------------------------
# Copyright (C) 2013 Numenta Inc. All rights reserved.
#
# The information and source code contained herein is the
# exclusive property of Numenta Inc. No part of this software
# may be used, reproduced, stored or distributed in any form,
# without explicit written authorization from Numenta Inc.
#-------------------------------------------------------------------------------
desc = """
This tool will find instances with the tag specified in the accompanying
########
### Assuming Tag Key == 'params' and Tag Value = 'frontend:foo:bar:numenta'
tag = 'params'
filters = {}
if tag:
filters["tag-key"] = tag
# Stupid EC2 wrapper needs to be removed
@iandanforth
iandanforth / command-line-tool-template.py
Last active December 22, 2015 07:29
Python command line tool template.
#! /usr/bin/python
import optparse
def main(options):
'''
Performs the amazingly useful tasks for this command line tool
'''
pass
#! /usr/bin/python
import os
import subprocess
import time
iteration = 1
def main():
@iandanforth
iandanforth / kmeansExample.py
Last active May 13, 2024 14:00
A pure python implementation of K-Means clustering. Optional cluster visualization using plot.ly.
#############################################################################
# Full Imports
from __future__ import division
import math
import random
"""
This is a pure Python implementation of the K-means Clustering algorithmn. The
original can be found here:
@iandanforth
iandanforth / gist:5835609
Created June 22, 2013 02:35
Dynamixel Setup
'''
How to work with the AX1 Sensor
git clone git@github.com:iandanforth/pydynamixel.git
git checkout axs1
python setup.py install
'''
import dynamixel
import time
@iandanforth
iandanforth / learningLoop.py
Last active December 16, 2015 20:29
Learning Loop - A simple bit of python code that illustrates biological style learning.
#!/usr/bin/python
import time
from random import randint
"""
#############################
Learning Loop
Our scenario is that of a simple creature in a very simple world.