Skip to content

Commit cbff610

Browse files
authored
Rename to go-ctr (#18)
* Add CosineSimilarity in readme * Fix link * Rename to go-ctr
1 parent 0aeeeef commit cbff610

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+150
-144
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ jobs:
4141
- name: compress go binary
4242
if: github.ref_type == 'tag'
4343
shell: bash
44-
run: for i in edgeRec_*; do zip "$(echo $i | sed 's/\..*//').zip" $i || 7z a -tzip "$(echo $i | sed 's/\..*//').zip" $i; done
44+
run: for i in go-ctr_*; do zip "$(echo $i | sed 's/\..*//').zip" $i || 7z a -tzip "$(echo $i | sed 's/\..*//').zip" $i; done
4545

4646
- name: Upload Release
4747
if: github.ref_type == 'tag'
4848
uses: softprops/action-gh-release@v1
4949
with:
50-
files: edgeRec*.zip
50+
files: go-ctr*.zip
5151
draft: true
5252

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ version := $(shell git describe --tags --always --dirty)
77
## run lint to format golang code
88
lint:
99
gofmt -w -s ./
10-
goimports -local github.com/auxten/edgeRec -w ./
10+
goimports -local github.com/auxten/go-ctr -w ./
1111

1212
## build frontend
1313
build-frontend:
@@ -16,8 +16,8 @@ build-frontend:
1616

1717
## build golang backend
1818
build: build-frontend
19-
CGO_ENABLED=1 go build -o edgeRec main.go
19+
CGO_ENABLED=1 go build -o go-ctr main.go
2020

2121
## build golang backend
2222
release-build: build-frontend
23-
CGO_ENABLED=1 go build -ldflags=" -X main.Version=$(version) -X main.Commit=$(commit)" -o "edgeRec_$$(go env GOOS)_$$(go env GOARCH)" main.go
23+
CGO_ENABLED=1 go build -ldflags=" -X main.Version=$(version) -X main.Commit=$(commit)" -o "go-ctr_$$(go env GOOS)_$$(go env GOARCH)" main.go

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
# edgeRec
1+
# go-ctr
22

33
![logo](art/logo.png)
44

5-
Deep Learning(Item2vec Embedding + MLP) based Feature-Engineering & Training & Predict all in one Recommendation System that can run on small server or edge device.
5+
Recommendation(Click-Through Rate Prediction) Framework for Go, including:
6+
7+
1. Model Training & Prediction
8+
1. Item2vec Embedding
9+
1. Feature-Engineering
10+
1. Common Cost Functions and Metric Functions: AUC, Accuracy, MSE, RMS, Binary Cross Entropy, etc.
11+
1. Common Models
612

713
# Models implemented
814

@@ -41,11 +47,11 @@ You can run the MovieLens training and predict demo by:
4147

4248
```shell
4349
# download and unzip the SQLite DB file
44-
wget https://github.com/auxten/edgeRec/files/9895974/movielens.db.zip && \
50+
wget https://github.com/auxten/go-ctr/files/9895974/movielens.db.zip && \
4551
unzip movielens.db.zip
46-
# compile the edgeRec and put it in the current directory
47-
GOBIN=`pwd` go install github.com/auxten/edgeRec@latest && \
48-
./edgeRec
52+
# compile the go-ctr and put it in the current directory
53+
GOBIN=`pwd` go install github.com/auxten/go-ctr@latest && \
54+
./go-ctr
4955
```
5056

5157
Wait for the message shown: `Listening and serving HTTP on :8080`.
@@ -101,7 +107,7 @@ if you prefer `show me the code`, just go to [MovieLens Example](example/moviele
101107
}
102108
```
103109
All you need to do is implement the functions of the gray part:
104-
![](art/edgerec.png)
110+
![](art/go-ctr.png)
105111

106112
# Features
107113

@@ -188,11 +194,11 @@ To make this project work, quite a lot of code are copied and modified from the
188194
- [go-fastapi](https://github.com/sashabaranov/go-fastapi)
189195
- Gopher logo with [GIMP](https://www.gimp.org/):
190196
- [ashleymcnamara/gophers](https://github.com/ashleymcnamara/gophers)
191-
- [JetBrains](https://www.jetbrains.com/?from=auxten/EdgeRec) for providing free license for this project.
197+
- [JetBrains](https://www.jetbrains.com/?from=auxten/go-ctr) for providing free license for this project.
192198
193199
# Papers related
194200
195201
- [YouTube DNN](https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/45530.pdf)
196202
- [Deep Interest Network for Click-Through Rate Prediction](https://arxiv.org/abs/1706.06978)
197203
- [Document Embedding with Paragraph Vectors](https://arxiv.org/abs/1507.07998)
198-
- [EdgeRec: Recommender System on Edge in Mobile Taobao](https://arxiv.org/abs/2005.08416) // not very identical implementation
204+
- [go-ctr: Recommender System on Edge in Mobile Taobao](https://arxiv.org/abs/2005.08416) // not very identical implementation
File renamed without changes.

example/futuresales/main_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import (
1010
"testing"
1111
"time"
1212

13-
"github.com/auxten/edgeRec/feature"
14-
"github.com/auxten/edgeRec/nn"
15-
"github.com/auxten/edgeRec/ps"
16-
"github.com/auxten/edgeRec/recommend"
17-
"github.com/auxten/edgeRec/schema"
18-
"github.com/auxten/edgeRec/utils"
13+
"github.com/auxten/go-ctr/feature"
14+
"github.com/auxten/go-ctr/nn"
15+
"github.com/auxten/go-ctr/ps"
16+
"github.com/auxten/go-ctr/recommend"
17+
"github.com/auxten/go-ctr/schema"
18+
"github.com/auxten/go-ctr/utils"
1919
log "github.com/sirupsen/logrus"
2020
. "github.com/smartystreets/goconvey/convey"
2121
)

example/movielens/dinimpl.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package movielens
33
import (
44
"fmt"
55

6-
"github.com/auxten/edgeRec/model"
7-
"github.com/auxten/edgeRec/model/din"
8-
rcmd "github.com/auxten/edgeRec/recommend"
6+
"github.com/auxten/go-ctr/model"
7+
"github.com/auxten/go-ctr/model/din"
8+
rcmd "github.com/auxten/go-ctr/recommend"
99
log "github.com/sirupsen/logrus"
1010
"gorgonia.org/tensor"
1111
)

example/movielens/dinimpl_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"math/rand"
77
"testing"
88

9-
rcmd "github.com/auxten/edgeRec/recommend"
10-
"github.com/auxten/edgeRec/utils"
9+
rcmd "github.com/auxten/go-ctr/recommend"
10+
"github.com/auxten/go-ctr/utils"
1111
. "github.com/smartystreets/goconvey/convey"
1212
)
1313

example/movielens/feature.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import (
1010
"strings"
1111
"sync"
1212

13-
"github.com/auxten/edgeRec/feature"
14-
"github.com/auxten/edgeRec/feature/ubcache"
15-
rcmd "github.com/auxten/edgeRec/recommend"
16-
"github.com/auxten/edgeRec/utils"
13+
"github.com/auxten/go-ctr/feature"
14+
"github.com/auxten/go-ctr/feature/ubcache"
15+
rcmd "github.com/auxten/go-ctr/recommend"
16+
"github.com/auxten/go-ctr/utils"
1717
_ "github.com/mattn/go-sqlite3"
1818
log "github.com/sirupsen/logrus"
1919
)

example/movielens/feature_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import (
55
"fmt"
66
"testing"
77

8-
"github.com/auxten/edgeRec/model/mlp"
9-
"github.com/auxten/edgeRec/nn/metrics"
10-
nn "github.com/auxten/edgeRec/nn/neural_network"
11-
rcmd "github.com/auxten/edgeRec/recommend"
8+
"github.com/auxten/go-ctr/model/mlp"
9+
"github.com/auxten/go-ctr/nn/metrics"
10+
nn "github.com/auxten/go-ctr/nn/neural_network"
11+
rcmd "github.com/auxten/go-ctr/recommend"
1212
log "github.com/sirupsen/logrus"
1313
. "github.com/smartystreets/goconvey/convey"
1414
"gonum.org/v1/gonum/mat"

example/movielens/prepare.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"context"
55
"database/sql"
66

7-
"github.com/auxten/edgeRec/feature/ubcache"
8-
rcmd "github.com/auxten/edgeRec/recommend"
9-
"github.com/auxten/edgeRec/utils"
7+
"github.com/auxten/go-ctr/feature/ubcache"
8+
rcmd "github.com/auxten/go-ctr/recommend"
9+
"github.com/auxten/go-ctr/utils"
1010
log "github.com/sirupsen/logrus"
1111
)
1212

example/movielens/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
Original Data: [MovieLens 100k](https://grouplens.org/datasets/movielens/100k/)
44

55
SQLite DB file:
6-
[movielens.db.zip](https://github.com/auxten/edgeRec/files/9895974/movielens.db.zip)
6+
[movielens.db.zip](https://github.com/auxten/go-ctr/files/9895974/movielens.db.zip)
77

88
To run the tests, you need download the SQLite DB file and put it in the current directory.
99

1010
```shell
1111
# download and unzip the SQLite DB file
12-
wget https://github.com/auxten/edgeRec/files/9895974/movielens.db.zip && unzip movielens.db.zip
12+
wget https://github.com/auxten/go-ctr/files/9895974/movielens.db.zip && unzip movielens.db.zip
1313
```
1414

1515
SQL that split training set and test set by 80% and 20% user:

example/movielens/youtube.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package movielens
33
import (
44
"fmt"
55

6-
"github.com/auxten/edgeRec/model"
7-
"github.com/auxten/edgeRec/model/youtube"
8-
rcmd "github.com/auxten/edgeRec/recommend"
6+
"github.com/auxten/go-ctr/model"
7+
"github.com/auxten/go-ctr/model/youtube"
8+
rcmd "github.com/auxten/go-ctr/recommend"
99
log "github.com/sirupsen/logrus"
1010
"gorgonia.org/tensor"
1111
)

example/movielens/youtube_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"math/rand"
77
"testing"
88

9-
rcmd "github.com/auxten/edgeRec/recommend"
10-
"github.com/auxten/edgeRec/utils"
9+
rcmd "github.com/auxten/go-ctr/recommend"
10+
"github.com/auxten/go-ctr/utils"
1111
. "github.com/smartystreets/goconvey/convey"
1212
)
1313

feature/embedding/corpus/corpus.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
package corpus
1616

1717
import (
18-
"github.com/auxten/edgeRec/feature/embedding/corpus/dictionary"
19-
"github.com/auxten/edgeRec/feature/embedding/util/verbose"
18+
"github.com/auxten/go-ctr/feature/embedding/corpus/dictionary"
19+
"github.com/auxten/go-ctr/feature/embedding/util/verbose"
2020
)
2121

2222
type Corpus interface {

feature/embedding/corpus/cpsutil/cpsutil.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"bufio"
1919
"io"
2020

21-
"github.com/auxten/edgeRec/feature/embedding/corpus/dictionary"
21+
"github.com/auxten/go-ctr/feature/embedding/corpus/dictionary"
2222
)
2323

2424
func scanner(r io.Reader) *bufio.Scanner {

feature/embedding/corpus/dictionary/huffman.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ package dictionary
1717
import (
1818
"sort"
1919

20-
"github.com/auxten/edgeRec/feature/embedding/corpus/dictionary/node"
20+
"github.com/auxten/go-ctr/feature/embedding/corpus/dictionary/node"
2121
)
2222

2323
func (d *Dictionary) HuffnamTree(dim int) []*node.Node {

feature/embedding/corpus/filter/options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ package filter
1717
import (
1818
"github.com/spf13/cobra"
1919

20-
"github.com/auxten/edgeRec/feature/embedding/corpus/dictionary"
20+
"github.com/auxten/go-ctr/feature/embedding/corpus/dictionary"
2121
)
2222

2323
var (

feature/embedding/corpus/fs/fs.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ import (
1818
"fmt"
1919
"strings"
2020

21-
"github.com/auxten/edgeRec/feature/embedding/corpus"
22-
"github.com/auxten/edgeRec/feature/embedding/corpus/cpsutil"
23-
"github.com/auxten/edgeRec/feature/embedding/corpus/dictionary"
24-
"github.com/auxten/edgeRec/feature/embedding/util/clock"
25-
"github.com/auxten/edgeRec/feature/embedding/util/verbose"
21+
"github.com/auxten/go-ctr/feature/embedding/corpus"
22+
"github.com/auxten/go-ctr/feature/embedding/corpus/cpsutil"
23+
"github.com/auxten/go-ctr/feature/embedding/corpus/dictionary"
24+
"github.com/auxten/go-ctr/feature/embedding/util/clock"
25+
"github.com/auxten/go-ctr/feature/embedding/util/verbose"
2626
)
2727

2828
type Corpus struct {

feature/embedding/corpus/memory/memory.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ import (
1818
"fmt"
1919
"strings"
2020

21-
"github.com/auxten/edgeRec/feature/embedding/corpus"
22-
"github.com/auxten/edgeRec/feature/embedding/corpus/cpsutil"
23-
"github.com/auxten/edgeRec/feature/embedding/corpus/dictionary"
24-
"github.com/auxten/edgeRec/feature/embedding/util/clock"
25-
"github.com/auxten/edgeRec/feature/embedding/util/verbose"
21+
"github.com/auxten/go-ctr/feature/embedding/corpus"
22+
"github.com/auxten/go-ctr/feature/embedding/corpus/cpsutil"
23+
"github.com/auxten/go-ctr/feature/embedding/corpus/dictionary"
24+
"github.com/auxten/go-ctr/feature/embedding/util/clock"
25+
"github.com/auxten/go-ctr/feature/embedding/util/verbose"
2626
)
2727

2828
type Corpus struct {

feature/embedding/emb/embedding.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"strconv"
2222
"strings"
2323

24-
"github.com/auxten/edgeRec/feature/embedding/emb/embutil"
24+
"github.com/auxten/go-ctr/feature/embedding/emb/embutil"
2525
"github.com/pkg/errors"
2626
)
2727

feature/embedding/emb/embedding_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"reflect"
2121
"testing"
2222

23-
"github.com/auxten/edgeRec/feature/embedding/emb/embutil"
23+
"github.com/auxten/go-ctr/feature/embedding/emb/embutil"
2424
"github.com/stretchr/testify/assert"
2525
)
2626

feature/embedding/model/model.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ package model
1717
import (
1818
"io"
1919

20-
"github.com/auxten/edgeRec/feature/embedding/model/modelutil/matrix"
21-
"github.com/auxten/edgeRec/feature/embedding/model/modelutil/vector"
20+
"github.com/auxten/go-ctr/feature/embedding/model/modelutil/matrix"
21+
"github.com/auxten/go-ctr/feature/embedding/model/modelutil/vector"
2222
)
2323

2424
type Model interface {

feature/embedding/model/modelutil/subsample/subsample.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"math"
1919
"math/rand"
2020

21-
"github.com/auxten/edgeRec/feature/embedding/corpus/dictionary"
21+
"github.com/auxten/go-ctr/feature/embedding/corpus/dictionary"
2222
)
2323

2424
type Subsampler struct {

feature/embedding/model/modelutil/vector/vector.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ import (
2020
"fmt"
2121
"io"
2222

23-
"github.com/auxten/edgeRec/feature/embedding/corpus/dictionary"
24-
"github.com/auxten/edgeRec/feature/embedding/model/modelutil/matrix"
25-
"github.com/auxten/edgeRec/feature/embedding/util/clock"
26-
"github.com/auxten/edgeRec/feature/embedding/util/verbose"
23+
"github.com/auxten/go-ctr/feature/embedding/corpus/dictionary"
24+
"github.com/auxten/go-ctr/feature/embedding/model/modelutil/matrix"
25+
"github.com/auxten/go-ctr/feature/embedding/util/clock"
26+
"github.com/auxten/go-ctr/feature/embedding/util/verbose"
2727
)
2828

2929
func InvalidTypeError(typ Type) error {

feature/embedding/model/word2vec/model.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
package word2vec
1616

1717
import (
18-
"github.com/auxten/edgeRec/feature/embedding/model/modelutil"
19-
"github.com/auxten/edgeRec/feature/embedding/model/modelutil/matrix"
18+
"github.com/auxten/go-ctr/feature/embedding/model/modelutil"
19+
"github.com/auxten/go-ctr/feature/embedding/model/modelutil/matrix"
2020
)
2121

2222
type mod interface {

feature/embedding/model/word2vec/optimizer.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ package word2vec
1717
import (
1818
"math/rand"
1919

20-
"github.com/auxten/edgeRec/feature/embedding/corpus/dictionary"
21-
"github.com/auxten/edgeRec/feature/embedding/corpus/dictionary/node"
22-
"github.com/auxten/edgeRec/feature/embedding/model/modelutil"
23-
"github.com/auxten/edgeRec/feature/embedding/model/modelutil/matrix"
20+
"github.com/auxten/go-ctr/feature/embedding/corpus/dictionary"
21+
"github.com/auxten/go-ctr/feature/embedding/corpus/dictionary/node"
22+
"github.com/auxten/go-ctr/feature/embedding/model/modelutil"
23+
"github.com/auxten/go-ctr/feature/embedding/model/modelutil/matrix"
2424
)
2525

2626
type optimizer interface {

0 commit comments

Comments
 (0)