Tag Archives: Machine learning

Some notes from PyGotham (corrections welcome)

Getting Rich with Comparison Methods 

Matt Story

the truth of x == y does not imply that x != y is false […] Mind == blown and mind != blown.

pro tip: when defining ‘__eq__’ also define ‘__ne__’ its reflection method

operators like ‘<‘ have reflection properties to handle ‘>’ when overridden
right-side reflection for left-side method

how much of life is wasted by not reading documentation first?

keep-calm-and-rtfm

python has a NotImplemented error. singleton constant

MRO –> method resolution order –> use the more specific class’s methods, regardless on which side of comparison
this is the reason to use mix-ins as opposed to normal inheritance

test ALL the things
import operator module to test all the cases for bitwise and arithmetic operators

eq, ne, lt, le, gt, ge – check for existence, return the thing or NotImplemented

@functools.total_ordering – may drastically reduce the code

comparison methods are well documented. fairly robust methodology to learn which method to use on right/left side. complex so need to test.

comparison methods do not need to return bools, so you can do whatever you want. harness asymmetrical and non-boolean comparisons… useful for lazy-loaded filtering, iteration

Continue reading

How to train your neural network using a genetic algorithm

Artificial neural networks can be used to solve a wide variety of tasks that are hard to solve using rule-based programming. A genetic algorithm (GA) is a search technique used in computing to find exact or approximate solutions to optimization and search problems.

xkcd: Genetic Algorithms

xkcd: Genetic Algorithms

Working with rgho to basically implement what’s described in the following paper for our project babelbrain: a machine learning algorithm to classify language of a given input.

Continue reading

Teaching machines is hard

Week four at Hacker School:

  1. User Authentication and Access Control: hashes, salts and cookies
  2. Project Euler using Julia
  3. Machine Learning with a neural network

This past week sounds like a productive week, but somehow I feel that I’m not accomplishing enough.  Does anyone else feel that no matter how much they accomplish, it’s not enough?

Maybe it’s my global (holistic) learner style that Mel explained, which causes me to jump around a lot and not feel satisfied with a concept until that magic aha-moment where everything finally clicks.

Global learner […] absorbs information almost randomly, in no apparent logical sequence. […] but sometimes everything “clicks” and thereafter she can do problems intuitively […]. Although these folks are often global systems thinkers and potentially super-creative, the structure of school poses difficulties for them and they frequently drop out.”

This week, I only hit that satisfying moment on 1 out of the 3 aforementioned projects.

Continue reading