Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
# Import TCN library from https://github.com/locuslab/TCN | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
from torch.nn.utils import weight_norm | |
def conv1d_same_padding(input, weight, bias=None, stride=1, dilation=1, groups=1): | |
input_length = input.size(2) | |
filter_length = weight.size(2) |
Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
The following work with Son of Grid Engine (SGE) 8.1.9 as configured on the University of Sheffield's ShARC and Iceberg clusters.
You can use the -hold_jid <<job-name or job-name>>
option to make jobs run
only when other jobs have finished, rather than having jobs start and sit
waiting for other tasks to complete.
""" | |
Clean and simple Keras implementation of network architectures described in: | |
- (ResNet-50) [Deep Residual Learning for Image Recognition](https://arxiv.org/pdf/1512.03385.pdf). | |
- (ResNeXt-50 32x4d) [Aggregated Residual Transformations for Deep Neural Networks](https://arxiv.org/pdf/1611.05431.pdf). | |
Python 3. | |
""" | |
from keras import layers | |
from keras import models |
import numpy as np | |
from subprocess import PIPE, run | |
from scipy.io.wavfile import read, write | |
## This is in case you have a numpy nd array of your sound, and the sampling rate | |
## isn't the same as another ndarray. This resamples the array by piping in and out of Sox | |
## This is a simple example with wav files encoded in float32, with only one channel (mono) | |
## These parameters can however be adjusted by tweaking -t and -c options in the sox command | |
with open("sample_48k.wav", "rb") as file_48k, open("sample_16k.wav", "rb") as file_16k: |
The gist here provides a script to automate the process of installing Sun Grid Engine (SGE) on a single EC2 machine.
SGE is a job scheduler for a computing cluster. This usually involves a cluster of multiple machines. However for many applications we don't need a massive computing cluster and a cluster of 8-30 nodes would be sufficient. In this tutorial we set-up SGE on a single amazon EC2 machine. The reasons for doing so are as follows:
% This is a modified version of matlab's building rref which calculates | |
% row-reduced echelon form in gf(2). Useful for linear codes. | |
% Tolerance was removed because yolo, and because all values | |
% should only be 0 or 1. @benathon | |
function [A] = g2rref(A) | |
%G2RREF Reduced row echelon form in gf(2). | |
% R = RREF(A) produces the reduced row echelon form of A in gf(2). | |
% | |
% Class support for input A: |
I recently needed a way to run unit tests on Travis for a project that uses Sun Grid Engine, Grid Map. Unfortunately, it seemed like no one had figured out how to set that up on Travis before (or simply create a single-machine installation without any user interaction). After hours of trial-and-error, I now know the secrets to making a single-machine installation of SGE that runs on Travis, and I'm sharing my script to prevent other people from going through the same frustrating experience.
To use the install_sge.sh
script below, you just need to copy all of the files in this gist to a travis
sub-directory directly under the root of your GitHub project, and add the following lines to your .travis.yml
before_install:
- travis/install_sge.sh
- export SGE_ROOT=/var/lib/gridengine
- export SGE_CELL=default
- export DRMAA_LIBRARY_PATH=/usr/lib/libdrmaa.so.1.0
# Copyright (c) 2013 Alexandre Drouin. All rights reserved. | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of | |
# this software and associated documentation files (the "Software"), to deal in | |
# the Software without restriction, including without limitation the rights to | |
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | |
# of the Software, and to permit persons to whom the Software is furnished to do | |
# so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in all |
""" Zoom FFT function""" | |
import numpy as np | |
from time import time | |
from scipy.fftpack import fft, ifft | |
from numpy import swapaxes | |
def chirpz(x, A=None, W=None, M=None): | |
"""chirpz(x, A, W, M) - Chirp z-transform of variable x |