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 time | |
import collections | |
import multiprocessing | |
def save_data(q): | |
while True: | |
try: | |
# pk = q.popleft() |
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
#!python | |
import numpy as np | |
cimport numpy as np | |
from cpython cimport bool | |
ctypedef np.float64_t data_t | |
cdef bool[:] alt_argrelmax(double[:] data, int order): | |
cdef int N = data.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
#!/bin/python | |
import sys | |
import numpy as np | |
import pylab as plt | |
import bottleneck as bn | |
total = int(open('/proc/meminfo').readline().split()[1]) | |
if len(sys.argv) == 1: |
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
''' | |
Created on 23 May 2014 | |
@author: david | |
@licence: CRAPL | |
http://matt.might.net/articles/crapl/ | |
''' | |
import numpy as np | |
from scipy.io import wavfile | |
from scipy.misc import imsave |
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
echo "deltarpm=0" >> /etc/dnf/dnf.conf | |
# Basic tools, quick install: | |
dnf install -y firefox htop kernel-tools vim-enhanced iotop nload | |
# Scientifc python dependencies: | |
dnf install -y python3-devel python3-virtualenv gcc-gfortran gcc gcc-c++ python3-pip hdf5-devel zlib-devel xz-devel libstdc++-devel lapack-devel glibc-devel graphviz graphviz-devel lzo-devel fftw fftw-devel boost boost-devel boost-openmpi-devel openblas-devel openblas openblas-openmp openblas-openmp64 openblas-threads openblas-threads64 redhat-rpm-config | |
# Mostly Matplotlib dependencies | |
dnf install -y libpng-devel agg-devel tcl-devel vtk-qt-tcl vtk-tcl vtk-devel vtk-qt-python tkinter gtk2-devel wxPython-devel wxGTK-devel wxGTK-gl wxGTK-media freetype-devel bzip2-devel PyQt4-devel cairo-devel pygtk2-devel tk-devel texlive-dvipng ffmpeg ffmpeg-devel ffmpeg-libs gstreamer-ffmpeg openjpeg-devel openjpeg2-devel python-qt5-devel |
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 as np | |
cimport numpy as np | |
cimport cython | |
import random | |
from math import ceil | |
from libc.math cimport log2 |
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
building 'ceygen.core' extension | |
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -march=core-avx-i -O2 -pipe -mtune=native -fPIC -Iceygen -I/usr/include/eigen3 -I/usr/include/python2.7 -c ceygen/core.cpp -o build/temp.linux-x86_64-2.7/ceygen/core.o -O2 -march=native -fopenmp | |
g++ -pthread -shared -Wl,-z,relro -march=core-avx-i -O2 -pipe -mtune=native build/temp.linux-x86_64-2.7/ceygen/core.o -L/usr/lib64 -lpython2.7 -o build/lib.linux-x86_64-2.7/ceygen/core.so -fopenmp | |
building 'ceygen.dtype' extension | |
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 |
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
(py27)[david@SQUIDS gpy_memtest]$ python memtest.py gpy | |
/home/david/.virtualenvs/py27/lib/python2.7/site-packages/numpy/core/numeric.py:294: FutureWarning:in the future, full((3, 3), 666) will return an array of dtype('int64') | |
/home/david/.virtualenvs/py27/lib/python2.7/site-packages/numpy/core/numeric.py:294: FutureWarning:in the future, full((3, 1), 42) will return an array of dtype('int64') | |
0 | |
[] | |
191 | |
[<GPy.models.gp_regression.GPRegression object at 0x7f97ce48f0d0>, {'_added_names_': set(['Gaussian_noise', 'rbf']), 'sampling_runs': [], 'mean_function': None, 'Y_normalized': ObsAr([[ 42.], | |
[ 42.], | |
[ 42.]]), '_fixes_': None, '_optimizer_copy_transformed': False, 'size': 3, 'parameters': [<GPy.core.parameterization.ties_and_remappings.Tie object at 0x7f97ce48fd90>, <GPy.kern._src.rbf.RBF object at 0x7f97ce48f1d0>, <GPy.likelihoods.gaussian.Gaussian object at 0x7f97ce48f850>], 'priors': <GPy.core.parameterization.index_operations.ParameterIndexOperations object at 0x7f97ce48fb50>, 'output_dim': |
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 division | |
import collections | |
from keras import backend as K | |
from keras import activations, initializations, regularizers, constraints | |
from keras.engine import InputSpec | |
from keras.engine.topology import Layer | |
class Tensordot(Layer): |
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 tables | |
class H5Generator(object): | |
def __init__(self, h5file): | |
self.h5 = tables.open_file(h5file) | |
self.n_rows = int(self.h5.root.target.shape[0]) | |
self.ix = 0 | |
self.feature_keys = ('atom_contacts', 'residue_contacts', 'rsa', 'surface_area_bins', 'dssp_ss', 'pssm') | |
self.target_key = 's_score' |
OlderNewer