Reinforcement learning is a mode of machine learning driven by the feedback from the environment on how good a string of actions of the learning agent turns out to be.
We consider here a reinforcement learning mechanism for neural networks
Reinforcement learning is a mode of machine learning driven by the feedback from the environment on how good a string of actions of the learning agent turns out to be.
We consider here a reinforcement learning mechanism for neural networks
#!/usr/bin/python3 | |
# CC-BY-4.0 | |
import sys, argparse | |
from random import shuffle, randrange, choice | |
# Collate lines, separating them by a space | |
s = ' '.join(sys.stdin.readlines()) | |
# Remove non-text |
#!/usr/bin/python3 | |
# Histograms for the number of types V(N) within the first N tokens. | |
# Comparison of natives vs learners. | |
# R. Andreev, 2017-05-11 (first version), CC BY 4.0 | |
# Designed for the ANGLISH corpus [Tortel 2008, via N. Ballier & P. Lisson] | |
# The texts are expected to be located in ./ANGLISH/*.txt |
#/bin/bash | |
# License-free | |
# Example: addpath PATH "/usr/bin" | |
addpath() { | |
varname=$1 | |
export $1="$2:${!varname}" | |
} |
function h = renice(h) | |
% function h = renice(h) | |
% | |
% h is a handle returned by PLOT and such | |
% | |
% RA, Apr 2008 -- Aug 2016 | |
% | |
% License: CC-BY-4.0 | |
set(0, 'DefaultTextInterpreter', 'tex'); |
def betti(G, C=None, verbose=False): | |
# G is a networkx graph | |
# C is networkx.find_cliques(G) | |
# RA, 2017-11-03, CC-BY-4.0 | |
# Ref: | |
# A. Zomorodian, Computational topology (Notes), 2009 | |
# http://www.ams.org/meetings/short-courses/zomorodian-notes.pdf |
# Find the rank of a binary matrix over Z/2Z | |
# (conceptual implementation) | |
# | |
# RA, 2017-11-07 (CC-BY-4.0) | |
# | |
# Adapted from | |
# https://triangleinequality.wordpress.com/2014/01/23/computing-homology/ | |
# | |
def binary_rank(M) : | |
# Compute the Betti numbers of a graph over Z/2Z. | |
# | |
# If G is a networkx graph then set | |
# C = networkx.find_cliques(G) | |
# This enumerates maximal cliques. | |
# | |
# Pass C to the function betti_bin, | |
# which returns a list of Betti numbers. | |
# | |
# RA, 2017-11-08 (CC-BY-4.0) |
#!/bin/bash | |
# Suppose you wish to connect to a server X on port 23 | |
# but you have to do this via another server Y like this: | |
# | |
# localhost> ssh -p 22 username@Y | |
# Y> ssh -p 23 username@X | |
# | |
# Instead, you can create an ssh tunnel on a local port, say 9999: | |
# localhost> ssh -nNT -L 9999:X:23 -p 22 username@Y |
#!/usr/bin/python3 | |
# AUTHOR, DATE | |
## ================== IMPORTS : | |
pass | |
import inspect | |