The following guide will show you how to deploy a simple microservice written in JavaScript using 𝚫 now.
It uses Open Source tools that are widely available, tested and understood:
- Node.JS
- NPM
- Express
import Data.List (insert) | |
fst3 (x,_,_) = x | |
snd3 (_,x,_) = x | |
trd3 (_,_,x) = x | |
toTuple2Int :: String -> (Int, Int) | |
toTuple2Int s = (read $ takeWhile (/=' ') s :: Int, read $ dropWhile (==' ') $ dropWhile (/=' ') s :: Int) | |
toTupleTuple2Int :: String -> (Int, (Int, Int)) |
""" | |
A deep neural network with or w/o dropout in one file. | |
""" | |
import numpy | |
import theano | |
import sys | |
import math | |
from theano import tensor as T | |
from theano import shared |
(* Sigma types *) | |
(* Inductive Sigma (A:Set)(B:A -> Set) :Set := Spair: forall a:A, forall b : B a,Sigma A B. *) | |
(* Definition E (A:Set)(B:A -> Set) (C: Sigma A B -> Set) (c: Sigma A B) *) | |
(* (d: (forall x:A, forall y:B x, C (Spair A B x y))): C c := *) | |
(* match c as c0 return (C c0) with *) | |
(* | Spair a b => d a b *) | |
(* end. *) |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"log" | |
) | |
// Event to record | |
type Event struct { |
--sample input | |
--dijkstra source dest [(n1,n2,e1),(n3,n4,e2)...] [(source,0)] | |
--dijkstra 1 4 [(1,2,5),(1,3,10),(2,4,100),(3,4,20)] [(1,0)] | |
--dijkstra 1 5 [(1,2,2), (2,3,1), (3,5,3), (4,5,4), (1,4,5), (1,3,8)] [(1,0)] | |
--ouput | |
-- a list of tuples with each tuple (n1,d1) representing the min. dist d1 of node n1 from source | |
inf = 100000 |
The following guide will show you how to deploy a simple microservice written in JavaScript using 𝚫 now.
It uses Open Source tools that are widely available, tested and understood:
--[[ | |
Efficient LSTM in Torch using nngraph library. This code was optimized | |
by Justin Johnson (@jcjohnson) based on the trick of batching up the | |
LSTM GEMMs, as also seen in my efficient Python LSTM gist. | |
--]] | |
function LSTM.fast_lstm(input_size, rnn_size) | |
local x = nn.Identity()() | |
local prev_c = nn.Identity()() | |
local prev_h = nn.Identity()() |
- Haskell Mergesort | |
- Copyright (C) 2014 by Kendall Stewart | |
First we define a couple of helper functions that | |
will be useful in splitting the list in half: | |
> fsthalf :: [a] -> [a] | |
> fsthalf xs = take (length xs `div` 2) xs |
quicksort :: (Ord a) => [a] -> [a] | |
quicksort [] = [] | |
quicksort (x:xs) = | |
let smallerSorted = quicksort (filter (<=x) xs) | |
biggerSorted = quicksort (filter (>x) xs) | |
in smallerSorted ++ [x] ++ biggerSorted |