Distributed Fieldaware Factorization Machines
TODO: SSE support for loss and grad
cnevd / difacto2_ffm Goto Github PK
View Code? Open in Web Editor NEWDistributed Fieldaware Factorization Machines based on Parameter Server
License: Other
Distributed Fieldaware Factorization Machines based on Parameter Server
License: Other
Hi,thanks for your work. Does this distributed FFM have any report?
How about the precision compared with libFFM when running on multiple machines and convergence situation?
I wondered how data is dispatched to different machines and make sure each machine reads different data.
Can you give me some suggestions when implement a distributed FFM on ps-lite from scratch? you can say in Chinese.
Thank you!
Using the example training file bigdata.tr.txt
and validation file bigdata.te.txt
to perform the ffm test:
difacto local.conf data_in=data/bigdata.tr.txt data_val=data/bigdata.te.txt learner=ffmsgd V_dim=4 max_num_epochs=10 batch_size=1000 has_aux=1 field_num=18
The program exits after only 2 epoch:
[12:23:58] /opt/codebase/dmlc/DiFacto2_ffm/src/sgd/sgd_learner.cc:80: Start epoch 0
1 200 2e+02 | 0 | 0.6932 0.64692
[12:23:59] /opt/codebase/dmlc/DiFacto2_ffm/src/sgd/sgd_learner.cc:82: Epoch[0] Training: Rows = 200, loss = 0.693153, AUC = 0.646919
[12:24:01] /opt/codebase/dmlc/DiFacto2_ffm/src/sgd/sgd_learner.cc:87: Epoch[0] Validation: Rows = 200, loss = 0.693147, AUC = 0.619823
[12:24:01] /opt/codebase/dmlc/DiFacto2_ffm/src/sgd/sgd_learner.cc:80: Start epoch 1
4 400 2e+02 | 0 | 0.6931 0.61127
[12:24:02] /opt/codebase/dmlc/DiFacto2_ffm/src/sgd/sgd_learner.cc:82: Epoch[1] Training: Rows = 200, loss = 0.693147, AUC = 0.611268
[12:24:04] /opt/codebase/dmlc/DiFacto2_ffm/src/sgd/sgd_learner.cc:87: Epoch[1] Validation: Rows = 200, loss = 0.693147, AUC = 0.619823
[12:24:04] /opt/codebase/dmlc/DiFacto2_ffm/src/sgd/sgd_learner.cc:94: Change of loss [8.80543e-06] < stop_rel_objv [1e-05]
It seems ffm can not converge during the training process
output:
[17:03:55] src/main.cc:40: - l1_shrk = 0
[17:03:55] src/main.cc:71: start run learner
[17:03:55] src/sgd/sgd_learner.cc:80: Start epoch 0
1 0 0 | 0 | -nan -nan
2 0 0 | 0 | -nan -nan
3 0 0 | 0 | -nan -nan
4 0 0 | 0 | -nan -nan
5 0 0 | 0 | -nan -nan
6 0 0 | 0 | -nan -nan
7 0 0 | 0 | -nan -nan
8 0 0 | 0 | -nan -nan
9 0 0 | 0 | -nan -nan
10 0 0 | 0 | -nan -nan
11 0 0 | 0 | -nan -nan
12 0 0 | 0 | -nan -nan
13 0 0 | 0 | -nan -nan
14 0 0 | 0 | -nan -nan
15 0 0 | 0 | -nan -nan
16 0 0 | 0 | -nan -nan
17 1e+04 1e+04 | 0 | 0.6931 0.55892
local.conf:
data_in = /data/data1/ffm/data/train.data
data_val = /data/data1/ffm/data/test.data
learner = sgd
max_num_epochs = 2
batch_size = 10000
field_num=68
V_dim = 2
has_aux=1
l1_shrk=0
void SGDUpdater::UpdateV(real_t const* gV, SGDEntry* e) {
int nnz = e->nnz;
for (int i = 0; i < feat_dim; ++i) {
real_t sg = e->Z[i];
real_t vi = e->V[i];
// update sqrt_g
real_t gv = gV[i] + vi * param_.l2;
**e->Z[i] = sqrt(sg * sg + gv * gv);
e->V[i] -= param_.lr * e->Z[i] * gv;**
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.