-
Install CMake 3.5.2 on CentOS 7
Download Source distributions cmake-3.5.2.tar.gz from https://cmake.org/download/ ./bootstrap gmake sudo gmake install
-
Install libgpuarray on Centos 7
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/python3 | |
import os | |
import sys | |
import subprocess | |
import re | |
def run(): | |
arguments = 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
# ================================================= | |
# SLURM UTILS | |
# ================================================= | |
# sbatlog: runs sbatch and automatically tail -f slurm-$number.out | |
function sbatlog | |
{ | |
result=$(command sbatch "$@") | |
outputid=$(echo $result | awk -F' ' '{print $NF}') | |
# fileout="slurm-$outputid.out" # assumes default file output name |
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 av | |
import numpy as np | |
def write_packets(filename, packets, video_stream): | |
container = av.open(filename, mode='w') | |
stream = container.add_stream(template=video_stream) | |
stream.options = {} | |
for p in packets: | |
if p.dts is not None: |
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
#!/usr/bin/env python3 | |
import sys | |
from hashlib import md5 | |
from base64 import b64encode | |
from binascii import hexlify, unhexlify | |
from time import time | |
def reduction_function(hash, max_password_length): |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
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
name: "VGG_FACE_16_layer" | |
input: "data" | |
input_dim: 1 | |
input_dim: 3 | |
input_dim: 224 | |
input_dim: 224 | |
layer { | |
name: "data" | |
type: "Data" | |
top: "data" |
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
# A yaml constructor is for loading from a yaml node. | |
# This is taken from @misha 's answer: http://stackoverflow.com/a/15942429 | |
def opencv_matrix_constructor(loader, node): | |
mapping = loader.construct_mapping(node, deep=True) | |
mat = np.array(mapping["data"]) | |
mat.resize(mapping["rows"], mapping["cols"]) | |
return mat | |
yaml.add_constructor(u"tag:yaml.org,2002:opencv-matrix", opencv_matrix_constructor) | |
# A yaml representer is for dumping structs into a yaml node. |
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 network is used for the video description experiments of S2VT [1]. | |
# Please consider citing S2VT [1] if you use this example in your work. | |
# | |
# [1] S. Venugopalan, M. Rohrbach, J. Donahue, R. Mooney, T. Darrell, | |
# K. Saenko. "Sequence to Sequence - Video to Text." ICCV 2015. | |
# The data is prepared using framefc7_stream_text_to_hdf5.py | |
# It is in (32) parallel streams. | |
name: "s2vt" | |
layer { |
NewerOlder