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 torch | |
from torch import nn | |
def convBlock(inc, outc, ksz, conv_or_deconv): | |
return nn.Sequential( | |
nn.Conv2d(in_channels=inc, out_channels=outc, kernel_size=ksz, | |
stride=2) if conv_or_deconv else nn.ConvTranspose2d(in_channels=inc, out_channels=outc, | |
kernel_size=ksz, stride=2), | |
nn.LeakyReLU(), | |
nn.BatchNorm2d(num_features=outc) |
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 matplotlib.pyplot as plt | |
from matplotlib.widgets import Slider, Button, RadioButtons | |
import librosa | |
fig, ax = plt.subplots() | |
plt.subplots_adjust(left=0.1, bottom=0.35) | |
samples = 1 | |
audio, sr = librosa.core.load("Snare.wav") # load your audio here |
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 os | |
import numpy as np | |
class DataLoader(): | |
def __init__(self, data_path, data_shape, index_path = 0, batch_size = 1): | |
self.data_path = data_path | |
self.data_shape = data_shape | |
self.data_index = self._load_data_index(index_path) if index_path else self._create_data_index(data_path) | |
self.shuffled_index = self.data_index | |
self.batch_size = batch_size |
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 math | |
def calculatePadding(L, KSZ, S, D, deconv = False): | |
''' | |
:param L: Input length (or width) | |
:param KSZ: Kernel size (or width) | |
:param S: Stride | |
:param D: Dilation Factor | |
:return: Returns padding such that output width is exactly half of input width | |
''' |
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
# ffmpeg -i filenameee.m4a -acodec libmp3lame -ab 256k output.mp3 |
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 librosa | |
import threading | |
import numpy as np | |
import os | |
num_splits = 8 | |
data_path = "ProcessedNumpys" | |
dataset = [] | |
def add_to_arr(i, data_path, filenames, start, end): |
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
#ifdef GL_ES | |
precision mediump float; | |
#endif | |
uniform vec2 u_resolution; | |
float rectshape(vec2 position, vec2 scale){ | |
scale = vec2(0.5) - scale * 0.5; | |
vec2 shaper = vec2(step(scale.x, position.x), step(scale.y, position.y)); |
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
// Where is the circle | |
let x, y; | |
let num_circles = 150; | |
let circles = []; | |
class Circle { | |
constructor() { | |
this.x = random(0, width) | |
this.y = random(0, height) | |
this.diameter = random(10, 30); |
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
var listOfColors = ["#1c77c3","#39a9db","#40bcd8","#f39237","#d63230","#540d6e","#ee4266","#ffd23f","#f3fcf0","#1f271b"]; | |
["#540d6e","#ee4266","#ffd23f","#f3fcf0","#1f271b"] | |
class Orbiter{ | |
constructor(cx,cy){ | |
this.centerX = cx | |
this.centerY = cy | |
this.positionX = 0 | |
this.positionY = 0 |
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
var listOfColors = ["#1c77c3", "#39a9db", "#40bcd8", "#f39237", "#d63230", "#540d6e", "#ee4266", "#ffd23f", "#f3fcf0", "#1f271b"]; | |
["#540d6e", "#ee4266", "#ffd23f", "#f3fcf0", "#1f271b"] | |
class Orbiter { | |
constructor(cx, cy) { | |
this.centerX = cx | |
this.centerY = cy | |
this.positionX = 0 | |
this.positionY = 0 |
OlderNewer