You won't believe this!
Let's say that you make a folder in Bash on Ubuntu on Windows
bash -c "mkdir zZz"
As you may know, files on Windows are case insensitive, so you can:
dir zZz
from __future__ import print_function | |
from ctypes import* | |
import sys | |
dllname = "opencl" | |
if len(sys.argv) >= 2: | |
dllname = sys.argv[1] | |
opencl = cdll.LoadLibrary(dllname) | |
pointerarray_type = c_void_p * 10 | |
platforms = pointerarray_type() |
#pragma once | |
#include <thread> | |
#include <chrono> | |
#include <cstdio> | |
#include <exception> | |
template<class Exception = std::exception, typename T1, typename T2, typename Func, typename ...Args> | |
void ProgressIndicator(T1 begin, T2* p, double total, const char* fmt, | |
bool enable, const Func& f, Args&&... args) |
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') |
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]]] + |
(* ::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] := |
# 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 |
# 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 |
from __future__ import print_function | |
import numpy | |
import theano | |
import sys | |
import time | |
n = 100000 | |
i = 10 | |
j = 10 | |
k = 10 |
# 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 | |
{ |