Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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
# the followings are expected to be installed | |
# | |
# virtualenv, git | |
# OpenBlas: https://github.com/xianyi/OpenBLAS | |
# cuda: https://developer.nvidia.com/cuda-downloads | |
ARGV=("$@") | |
function check_command | |
{ |
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 __future__ import print_function | |
import numpy | |
import theano | |
import sys | |
import time | |
n = 100000 | |
i = 10 | |
j = 10 | |
k = 10 |
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
# the script assumes OpenBlas and Cuda installation | |
# make sure to have these in PATH (maybe not all are necessary) | |
# /usr/local/bin | |
# /usr/bin | |
# /bin | |
# /usr/local/cuda/ | |
# /usr/local/cuda/bin | |
virtualenv tensorflow | |
source tensorflow/bin/activate |
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
# presupposes that theano with gpu is already installed | |
FILENAME=theano_cnmem_text.log | |
export THEANO_FLAGS="gpuarray.preallocate=0.5,device=cuda,floatX=float32" | |
A_BIT=2 | |
pip install -U nvidia-ml-py | |
# http://stackoverflow.com/questions/5947742/how-to-change-the-output-color-of-echo-in-linux | |
RED='\033[0;31m' | |
NC='\033[0m' # No Color |
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
(* ::Package:: *) | |
BeginPackage["Hamiltonian`"] | |
arg::usage = "Generates symbolic argument list of given length, optionally given symbol name."; | |
arg[n_, symbol_: q] := | |
Table[Symbol[ToString[symbol] <> ToString[i]], {i, 1, n}] | |
KineticEnergy::usage = "Generates kinetic energy formula from parameterized coordinates."; | |
KineticEnergy[X_, M_, n_, qsym_: q, tsym_: t] := |
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
BeginPackage["Geodetics`"] | |
ChristoffelSymbols::usage = "Calculates Christoffel symbols of the second kind. | |
Provide the Riemannian metric as a matrix vaued function and the number of parameters."; | |
ChristoffelSymbols[G_, n_] := | |
Function[{Args(*=Table[Subscript[x, q], {q, n}]*)}, | |
Module[{ginv=Inverse[G@Args]}, | |
Table[ | |
1/2 Sum[ | |
ginv[[m, k]] (D[G[Args][[k, i]], Args[[j]]] + |
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 __future__ import print_function | |
import numpy | |
import theano | |
import theano.tensor as T | |
from thextensions import * | |
from sklearn.utils.extmath import softmax | |
import matplotlib | |
matplotlib.use('Agg') |
OlderNewer