Real brains do not organize neurons into layers. It's a messy process where one neuron could connect directly to the input and the output, while another neuron is in a long chain, while a third neuron is connected to twenty different nodes at different depths. Who decided that artificial neural networks should be very constrained in terms of shape? Is it computational convenience, or does it actually work better?
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 collections import defaultdict | |
def simple_cycles(G): | |
def _unblock(thisnode,blocked,B): | |
stack = set([thisnode]) | |
while stack: | |
node = stack.pop() | |
if node in blocked: | |
blocked.remove(node) | |
stack.update(B[node]) |
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 'map' also known as a 'dictionary' also known as a 'hashmap': | |
# https://en.wikipedia.org/wiki/Hash_table | |
# It maps 'keys' to 'values'. Keys and values can be anything: strings, tuples, integers, floats... | |
# Here, the keys are integers and the values are lists of integers. | |
d = { | |
1: [1,2,3,4,5,6,7,8,9,0], | |
2: [2,3,5,6,8,9,0], | |
3: [3,6,9], | |
4: [4,5,6,7,8,9,0], | |
5: [5,6,8,9,0], |
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
#! /usr/bin/python | |
# -*- coding: utf8 -*- | |
""" GAN-CLS """ | |
import tensorflow as tf | |
import tensorlayer as tl | |
from tensorlayer.layers import * | |
from tensorlayer.prepro import * | |
from tensorlayer.cost import * | |
import numpy as np |
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
var lukemath = new (function() { | |
var privatePi = 3.14; | |
this.tau = 2 * privatePi; | |
var privateSquare = function(n) { | |
return n * n; | |
} | |
this.fourth = function(n) { | |
return privateSquare(privateSquare(n)); | |
} | |
})(); |
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
# You run this with `$ python mastml.py settings.conf data.csv -o results/` | |
# Second example: `$ python mastml.py input.conf compositions.csv -o Desktop/model-results/` | |
# Or you open the website, upload a csv, upload a conf file, and download the resulting zip file | |
# Sections and subsections are in CamelCase; parameters are in snake_case | |
[GeneralSetup] | |
input_features = Auto # Defaults to all but last column (specifying Auto is same as omiting this option) |
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
# Proof of undecidability of halting problem: | |
from Turing import will_halt | |
# will_halt(program, input) -> does_halt | |
def loop_forever(garbage_input): | |
return loop_forever(garbage_input) | |
def square_root(n): | |
return n ** 0.5 |
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
""" | |
A minimal implementation of Monte Carlo tree search (MCTS) in Python 3 | |
Luke Harold Miles, July 2019, Public Domain Dedication | |
See also https://en.wikipedia.org/wiki/Monte_Carlo_tree_search | |
https://gist.github.com/qpwo/c538c6f73727e254fdc7fab81024f6e1 | |
""" | |
from abc import ABC, abstractmethod | |
from collections import defaultdict | |
import math |
OlderNewer