Coder Social home page Coder Social logo

castellanzhang / alphafm_softmax Goto Github PK

View Code? Open in Web Editor NEW
70.0 70.0 31.0 14 KB

Multi-thread implementation of Factorization Machines with FTRL for multi-class classification problem which uses softmax as hypothesis.

License: MIT License

Makefile 0.98% C++ 99.02%

alphafm_softmax's People

Contributors

castellanzhang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

alphafm_softmax's Issues

是不是我的使用方法不正确?

您好。
我用了一份公开的多分类数据集来做尝试,数据集如下:
https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multiclass.html#sector
为了方便与传统的LR比较,-dim参数我使用1,1,0
训练命令如下:
cat sector.scale | ./fm_train_softmax -m this_model -cn 105 -dim 1,1,0 -w_l1 0.05 -v_l1 0.05 -init_stdev 0.001 -w_alpha 0.01 -v_alpha 0.01 -core 10
测试命令如下:
cat sector.scale | ./fm_predict_softmax -m this_model -cn 105 -dim 0 -out output --->acc:41%左右
cat sector.t.scale | ./fm_predict_softmax -m this_model -cn 105 -dim 0 -out output --->acc:24%左右
感觉与LR差得太远了,是不是我的使用方法不正确?

模型文件格式能否具体说明一下呢?

bias,feature的组成能否说明一下。
多分类情况下,bias指的是w0?w1没有保存在模型文件中?
feature的对应的V向量,它的shape是多少呢?不是1 x k吗?
多谢!

预测时报 load model error[已解决]

按教程步骤,train+predict
train过程正常结束,模型格式看起来也正常
但predict过程,很快报“load model error”的错误 ?
“cat test | ./bin/fm_predict_softmax -cn 33 -core 10 -m fm_model.txt -out fm_pre.txt”

请问怎么解决

您好,我遇到的问题是模型预测阶段load模型时,ftrl_model.h 在加载权重会出现 `7.62416e-314` 这种值,` std(modelLineSeg[start + 2 + factor_num]) ` 会报错,提示 `out of range`,查了一下是 double 下溢。

您好,我遇到的问题是模型预测阶段load模型时,ftrl_model.h 在加载权重会出现 7.62416e-314 这种值,std(modelLineSeg[start + 2 + factor_num]) 会报错,提示 out of range,查了一下是 double 下溢。

ftrl_model_class_unit(int factor_num, const vector<string>& modelLineSeg, int start)
    {
        vi.resize(factor_num);
        v_ni.resize(factor_num);
        v_zi.resize(factor_num);
        int idx = 0;
        try{
            wi = stod(modelLineSeg[start + 1]);
            w_ni = stod(modelLineSeg[start + 2 + factor_num]); # 这一行
            w_zi = stod(modelLineSeg[start + 3 + factor_num]); # 这一行
            for(int f = 0; f < factor_num; ++f)
            {
                idx = f;
                vi[f] = stod(modelLineSeg.at(start + 2 + f)); # 这一行
                v_ni[f] = stod(modelLineSeg[start + 4 + factor_num + f]); # 这一行
                v_zi[f] = stod(modelLineSeg[start + 4 + 2 * factor_num + f]); # 这一行
            }

请问这个是什么原因呢,在模型保存的时候格式的问题吗?

Originally posted by @WilliamL1 in #3 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.