This file contains hidden or 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
""" | |
This module manages interactions with the autograd library. | |
""" | |
import autograd.numpy as anp | |
import numpy as np | |
from autograd import elementwise_grad, jacobian | |
from sympy import lambdify | |
# NumPyPrinter requires unreleased sympy 0.7.7 (in sympy master) | |
# if you aren't using Piecewise or logical operators | |
# you can change NumPyPrinter to LambdaPrinter in this module |
This file contains hidden or 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
start on filesystem or runlevel [2345] | |
stop on shutdown | |
description "Jupyter / IPython Notebook Upstart script" | |
script | |
export HOME="/home/phil/Notebooks"; cd $HOME | |
echo $$ > /var/run/ipython_start.pid | |
exec su -s /bin/sh -c 'exec "$0" "$@"' phil -- /home/phil/Enthought/Canopy_64bit/User/bin/jupyter-notebook --config='/home/phil/.jupyter/jupyter_notebook_config.py' | |
end script |
This file contains hidden or 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
# Create some sample data | |
CV_1 <- 0.2 | |
CV_2 <- 0.3 | |
Mean <- 65 | |
sigma_1 <- sqrt(log(1 + CV_1^2)) | |
mu_1 <- log(Mean) - sigma_1^2 / 2 | |
sigma_2 <- sqrt(log(1 + CV_2^2)) | |
mu_2 <- log(Mean) - sigma_2^2 / 2 | |
q <- c(0.25, 0.5, 0.75, 0.9, 0.95) | |
SummaryTable <- data.frame( |
This file contains hidden or 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 requests | |
import json | |
from time import sleep | |
data = [] | |
print("Fetching page #%s" % 1) | |
r = requests.get("http://declarations.com.ua/search?format=opendata").json() | |
data += r["results"]["object_list"] |
This file contains hidden or 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 zmq | |
import time | |
from multiprocessing import Process | |
import numpy as np | |
from pprint import pprint | |
import json | |
np.set_printoptions(precision=3) | |
This file contains hidden or 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 zmq | |
import time | |
from multiprocessing import Process | |
import numpy as np | |
np.set_printoptions(precision=3) | |
def send_array(socket, A, flags=0, copy=True, track=False): | |
"""send a numpy array with metadata""" | |
md = dict(dtype=str(A.dtype), shape=A.shape) |
This file contains hidden or 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 as np | |
import pandas as pd | |
from functools import partial | |
def summary(df, fn=np.sum, axis=0, name='Total', | |
table_class_prefix='dataframe-summary'): | |
"""Append a summary row or column to DataFrame. | |
Input: | |
------ |
This file contains hidden or 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
#include <opencv2/core/core.hpp> | |
#include <opencv2/highgui/highgui.hpp> | |
#include <opencv2/ocl/ocl.hpp> | |
// cl_mem構造体を参照するためにインクルード | |
#if defined __APPLE__ | |
#include <OpenCL/cl.h> | |
#else | |
#include <CL/cl.h> | |
#endif |
This file contains hidden or 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
Testing results. | |
Timing the functions. | |
Timing: cython | |
cython time: 0.00288254904747 s | |
Timing: numpy_broadcast | |
numpy_broadcast time: 0.00597401690483 s |
This file contains hidden or 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
--- /Library/Frameworks/R.framework/Resources/etc/Makeconf 2013-09-25 08:59:05.000000000 -0300 | |
+++ Makeconf 2014-03-03 13:01:00.000000000 -0400 | |
@@ -14,11 +14,11 @@ | |
AWK = awk | |
BLAS_LIBS = -L$(R_HOME)/lib$(R_ARCH) -lRblas | |
C_VISIBILITY = | |
-CC = llvm-gcc-4.2 -arch x86_64 -std=gnu99 | |
+CC = clang -arch x86_64 -std=gnu99 | |
CFLAGS = -mtune=core2 -g -O2 $(LTO) | |
CPICFLAGS = -fPIC |
NewerOlder