Skip to content

Instantly share code, notes, and snippets.

View masterdezign's full-sized avatar

masterdezign

View GitHub Profile
@masterdezign
masterdezign / dct.hs
Created December 5, 2015 18:27 — forked from vi/dct.hs
Simple command-line Discrete Cosine Transform in Haskell
-- "cabal install vector-fftw split"
import qualified Numeric.FFT.Vector.Unnormalized as FFT
import Data.Vector (fromList, toList)
import Data.List.Split (splitOneOf)
import Data.List (intersperse)
import Control.Monad (forever)
import Control.Arrow ((>>>))
main = forever $
@masterdezign
masterdezign / CrazyIO.hs
Created December 19, 2015 13:27 — forked from nkpart/CrazyIO.hs
CrazyIO - binary deserialization using mmaped I/O and Data.Vector.Storable
{-# LANGUAGE ScopedTypeVariables #-}
module CrazyIO (module CrazyIO, mmapFileByteString) where
import qualified Data.Vector.Storable as V
import qualified Data.ByteString as BS
import qualified Data.ByteString.Internal as BS
import Foreign
import System.IO.MMap
crazyLoad :: forall a. Storable a => FilePath -> Maybe (Int64, Int) -> IO (V.Vector a)
@masterdezign
masterdezign / min-char-rnn.py
Created February 17, 2016 17:28 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@masterdezign
masterdezign / xor_keras.py
Created August 31, 2016 10:25 — forked from cburgdorf/xor_keras.py
Comparing XOR between tensorflow and keras
import numpy as np
from keras.models import Sequential
from keras.layers.core import Activation, Dense
from keras.optimizers import SGD
X = np.array([[0,0],[0,1],[1,0],[1,1]], "float32")
y = np.array([[0],[1],[1],[0]], "float32")
model = Sequential()
model.add(Dense(2, input_dim=2, activation='sigmoid'))
@masterdezign
masterdezign / cuda_11.2_installation_on_Ubuntu_20.04
Created February 16, 2022 10:32 — forked from Mahedi-61/cuda_11.8_installation_on_Ubuntu_22.04
Instructions for CUDA v11.2 and cuDNN 8.1 installation on Ubuntu 20.04 for Pytorch 1.8 & Tensorflow 2.7.0
#!/bin/bash
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
### to verify your gpu is cuda enable check
@masterdezign
masterdezign / install-ghc.md
Created December 5, 2015 14:36 — forked from yantonov/install-ghc-ubuntu.md
How to install latest GHC 7.10.2 from source + stack 0.1.6.0 + cabal 1.22.4.0 + cabal-install 1.22.6.0 on ubuntu

How to install latest GHC 7.10.2 from source + stack 0.1.6.0 + cabal 1.22.4.0 + cabal-install 1.22.6.0 on ubuntu

for your convinience these instuction is available as:
gist
git repo

settings

GHC_VERSION="7.10.2"  

ARCHITECTURE="x86_64"