Skip to content

Instantly share code, notes, and snippets.

View walexi's full-sized avatar

Olawale Onabola walexi

View GitHub Profile
@walexi
walexi / tied_linear.py
Created July 1, 2020 22:55 — forked from InnovArul/tied_linear.py
tied linear layer experiment
import torch, torch.nn as nn, torch.nn.functional as F
import numpy as np
import torch.optim as optim
# tied autoencoder using off the shelf nn modules
class TiedAutoEncoderOffTheShelf(nn.Module):
def __init__(self, inp, out, weight):
super().__init__()
self.encoder = nn.Linear(inp, out, bias=False)
self.decoder = nn.Linear(out, inp, bias=False)
const hash = require("crypto-js/sha256");
/**
* Block class implements a typical block in the chain, has all the methods calculateHash and mineBlock and a constructor method to
* initialize the properties of the block
*/
class Block {
/**
* [constructor method to initialize the properties of the block]
* @param {[Number]} index [the position of the block in the chain]
@walexi
walexi / split-paragraphs.js
Created October 26, 2017 08:23 — forked from kavanagh/split-paragraphs.js
Split a string into paragraphs
var body = '<p>' + (row.body || '').split(/[\r\n\t]+/gm).join('</p><p>') + '</p>';
@walexi
walexi / stream_to_youtube.sh
Created August 27, 2017 04:47 — forked from olasd/stream_to_youtube.sh
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube