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 | |
# 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 |
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
# 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) : | |
#!/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 |
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'); |
#/bin/bash | |
# License-free | |
# Example: addpath PATH "/usr/bin" | |
addpath() { | |
varname=$1 | |
export $1="$2:${!varname}" | |
} |
#!/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 | |
#!/usr/bin/env python3 | |
#coding=utf-8 | |
import subprocess | |
IP = subprocess.run("dig +short myip.opendns.com @resolver1.opendns.com".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode('UTF-8').split()[0] | |
print("IP:", IP) | |
# https://api.aliyun.com/new#/?product=Alidns&api=UpdateDomainRecord¶ms={}&tab=DEMO&lang=PYTHON |
help: | |
@echo Put this script at the root of the git project. | |
@echo | |
@echo Add the following lines to the .gitignore file: | |
@echo " ""**/UV/**" | |
@echo " ""!**/UV/unversioned" | |
@echo | |
@echo Run | |
@echo " ""make unversioned" | |
@echo to create the listings of unversioned files in |