Julia is a new languange for technical computing. It is a mix of R, Matlab, Python and other similar languages. Its main advantage is its speed: it is just in time (JIT) compiled and almost as fast as C. Another advantage is its type inference, i.e. you do not have to specify types (although you can), but all variables are statically typed. It is a high level language that is fast as well. Here I compare the behavior to similar
This file contains 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
# Get the dataset here: http://www.gaussianprocess.org/gpml/data/ | |
import scipy.io | |
# Load training set | |
train = scipy.io.loadmat("sarcos_inv.mat") | |
# Inputs (7 joint positions, 7 joint velocities, 7 joint accelerations) | |
Xtrain = train["sarcos_inv"][:, :21] | |
# Outputs (7 joint torques) | |
Ytrain = train["sarcos_inv"][:, 21:] |
This file contains 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 numpy import * | |
from pylab import * | |
import numpy | |
from sklearn.mixture import GMM | |
from mpl_toolkits.mplot3d import axes3d | |
numpy.random.seed(0) | |
X = arange(0, 2*numpy.pi, 0.01) | |
N = len(X) |
This file contains 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
import numpy | |
import pylab | |
steps = 100 | |
zeros = numpy.zeros(steps) | |
ideal = numpy.linspace(0, 1, steps) | |
pylab.figure() | |
pylab.xlabel("Training Error") | |
pylab.ylabel("Test Error") |
This file contains 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
reset | |
set pm3d | |
set hidden3d | |
set isosample 100, 100 | |
unset surface | |
unset xtics | |
unset ytics | |
unset ztics | |
unset border | |
unset key |
This file contains 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
max_hits = 3 | |
puts "HA" | |
dps_ha = 1.15 * (0...max_hits).map do |i| 0.35**i end.reduce(:+) | |
puts sprintf("%.3f", dps_ha) | |
puts "" | |
puts "PA" | |
dps_pa = 1.15 * (0...max_hits).map do |i| 0.5**i end.reduce(:+) | |
puts sprintf("%.3f", dps_pa) |
This file contains 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
require 'rubygems' | |
require 'diablo3-api-client' | |
# TODO | |
# fury / barb attributes | |
# block | |
# edp only for dh | |
# efp for barbs? | |
# monks | |
# wizards |
This file contains 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 openann import * | |
import numpy | |
if __name__ == "__main__": | |
# Create dataset | |
X = numpy.array([[0, 1], [0, 0], [1, 1], [1, 0]]) | |
Y = numpy.array([[1], [0], [0], [1]]) | |
D = X.shape[1] | |
F = Y.shape[1] | |
N = X.shape[0] |
This file contains 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
import numpy | |
def sq_exp(x1, x2, w, sigma_f): | |
#return sigma_f**2 * numpy.exp(-(numpy.abs(x1-x2)/w).sum()) # Ornstein-Uhlenbeck | |
return sigma_f**2 * numpy.exp(-0.5*((x1-x2)**2/w**2).sum()) | |
class GPR(object): | |
def __init__(self, w, sigma_f, sigma_n): | |
self.w = w | |
self.sigma_f = sigma_f |
Complex git operations and commands that I always forget...
OlderNewer