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
GHC_VERSION="7.10.2"
ARCHITECTURE="x86_64"
from random import random | |
from numpy import tanh | |
from scipy import array, vectorize, transpose | |
class Network: | |
""" Class builds neural network | |
""" | |
def __init__(self, inputs, outputs, hlayers=None, activation=tanh, | |
learning_rate=1.): |
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')) |
""" | |
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) |
{-# 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) |
-- "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 $ |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>My Presentation</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | |
<style type="text/css"> | |
.red { color: red } | |
</style> | |
</head> | |
<body> |