- Python 3
- Pip 3
$ brew install python3
#!/usr/bin/python3 | |
# coding: utf-8 | |
import requests | |
from bs4 import BeautifulSoup | |
from scrapy import Selector | |
import csv | |
import datetime |
# neat-python configuration for the LunarLander-v2 environment on OpenAI Gym | |
# Sample run here: https://gym.openai.com/evaluations/eval_FbKq5MxAS9GlvB7W6ioJkg | |
# NOTE: This was run using revision 1186029827c156e0ff6f9b36d6847eb2aa56757a of CodeReclaimers/neat-python, not a release on PyPI. | |
[NEAT] | |
pop_size = 150 | |
# Note: the fitness threshold will never be reached because | |
# we are controlling the termination ourselves based on simulation performance. | |
fitness_criterion = max | |
fitness_threshold = 1000.0 |
# Code example for: | |
# Hello World - Machine Learning Recipes #1 - Google Developers | |
# https://www.youtube.com/watch?v=cKxRvEZd3Mw | |
from sklearn import tree | |
# Bumpy = 0, Smooth = 1 | |
features = [[140, 1], [130, 1], [150, 0], [170, 0]] | |
# Apple = 0, Orange = 1 | |
labels = [0, 0, 1, 1] |
""" | |
This is a batched LSTM forward and backward pass | |
""" | |
import numpy as np | |
import code | |
class LSTM: | |
@staticmethod | |
def init(input_size, hidden_size, fancy_forget_bias_init = 3): |
<?php | |
$values = array( | |
'true' => true, | |
'false' => false, | |
'1' => 1, | |
'0' => 0, | |
'-1' => -1, | |
'"true"' => "true", | |
'"false"' => "false", | |
'"1"' => "1", |
from pylab import * | |
from pprint import pprint | |
def arrayToList(arr): | |
if type(arr) == type(array([])): | |
return arrayToList(arr.tolist()) | |
elif type(arr) == type([]): | |
return [arrayToList(a) for a in arr] | |
else: |
from hashlib import sha1 | |
import numpy | |
arr=numpy.zeros((256,256,4)) | |
sha1(arr) |
import requests | |
import sys | |
for i in range(1,10000): | |
response = requests.post('http://apply.embed.ly/1', data={'answer': str(i)}) | |
if response.status_code == 302: | |
print i | |
sys.exit(0) |