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/bash | |
MULT="100" | |
NIGHTLIES=14 | |
STABLE=13 | |
LOWEST=11 | |
RAPIDS_VERSION="0.$STABLE" | |
RAPIDS_RESULT=$STABLE | |
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 http.server import HTTPServer, BaseHTTPRequestHandler | |
from io import BytesIO | |
import os | |
import json | |
from pyautogui import press | |
def do_POST(self): | |
press('space') | |
# Standard respnse sequence headers fill here |
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 network | |
import urequests | |
import ujson | |
import machine | |
import time | |
def do_post(url, data): | |
headers = {'Content-Type': 'application/json'} |
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
// Prabindh Sundareson 2020 | |
// Age of the lockdown | |
#include "pch.h" // include #include "httplib.h" in this file | |
#include <iostream> | |
static httplib::Server svr; | |
void pressSpace() | |
{ |
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
$ diff ~/Downloads/yolov3.cfg-master.txt ~/Downloads/yolov3.cfg-alexeyab.txt | |
3,4c3,4 | |
< # batch=1 | |
< # subdivisions=1 | |
--- | |
> batch=1 | |
> subdivisions=1 | |
6,9c6,9 | |
< batch=64 | |
< subdivisions=16 |
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
# conv1d for timeseries spike | |
model = models.Sequential() | |
model.add(layers.Conv1D(filters = 1, | |
kernel_size = 10, | |
activation = 'relu', | |
input_shape=(timesteps,1))) | |
model.add(layers.GlobalMaxPooling1D()) | |
model.add(layers.Flatten()) | |
model.add(layers.Dense(1, activation = 'sigmoid')) |
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 | |
from numpy.lib.stride_tricks import as_strided | |
import tensorflow as tf | |
import time | |
def conv2dTrickster(a, b): | |
a = as_strided(a,(len(a),a.shape[1]-len(b)+1,a.shape[2]-b.shape[1]+1,len(b),b.shape[1],a.shape[3]),a.strides[:3]+a.strides[1:]) | |
return np.einsum('abcijk,ijkd', a, b[::-1,::-1]) | |
def conv2dSimple(image, filter): |
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 keras.datasets import mnist | |
from keras.layers import Dense, Input, concatenate,subtract, Lambda | |
from keras.losses import binary_crossentropy | |
from keras.optimizers import SGD | |
(train_x, train_y), (test_x, test_y) = mnist.load_data() | |
train_x = (train_x / 255.0).reshape(-1, 28*28) | |
test_x = (test_x / 255.0).reshape(-1, 28*28) | |
inp1 = Input(shape=(28*28,)) |
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
CuDNNGRU stateful implementation, TensorFlow backend | |
Layers: (300,80,150) -- (encoder, latent, decoder) -- (selu, tanh, tanh) | |
return_sequences=True for all layers | |
GaussianNoise + Dropout at (=after) input, AlphaDropout at encoder, Dropout at latent | |
BatchNormalization between encoder and latent, latent and decoder | |
Output: TimeDistributed(Dense(units=input_dim, activation='linear')) | |
batch_size=25, timesteps=400, input_dim=16 - 25 separate, 10-min sequences fed 400 timesteps (=1 sec) at a time (as 10*60=600 'windows' in parallel, non-shuffled) | |
reset_states() applied before testing on new x25 10-min sequences | |
model.fit, or train_on_batch for training |
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 keras.models import Sequential | |
from keras.layers import Dense | |
import numpy as np | |
def normalize_angles(phases): | |
phases = phases + np.pi | |
phases /= (2 * np.pi) | |
return phases | |
def build_fourier_mnist(): |