Skip to content

Instantly share code, notes, and snippets.

View helinwang's full-sized avatar

Helin Wang helinwang

  • Bay Area
View GitHub Profile
@helinwang
helinwang / gist.go
Last active December 11, 2016 16:27
save and load tensorflow tensors using tensorflow golang api
// Save:
outTensor, err := tf.NewTensor(filename)
if err != nil {
return err
}
_, err = session.Run(
map[tf.Output]*tf.Tensor{
graph.Operation("save/Const").Output(0): outTensor,
},
nil,
@helinwang
helinwang / tf_idf.go
Last active January 27, 2016 08:14
calculate max tfidf of each word in text corpus (given directory) in golang
package main
import (
"flag"
"fmt"
"io/ioutil"
"math"
"os"
"sort"
"strings"
@helinwang
helinwang / gist:ea9a2e88f20278d2cb53
Created June 17, 2014 13:49
golang https server
package main
import (
"net/http"
"fmt"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Println("Inside handler")
fmt.Fprintf(w, "Hello world from my Go program!")