Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VecMVM #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add VecMVM #61

wants to merge 1 commit into from

Conversation

tczhp
Copy link

@tczhp tczhp commented Aug 1, 2016

No description provided.

val newGrad = grad(i)(j) / (math.sqrt(his(i)(j)) + eps)
if(newGrad != 0.0) {
factors(i)(j) -= stepSize * (newGrad + factors(i)(j) * regParamL2)
if(shrinkageVal > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L1 的参数大于0时,会导致精度下降. 可以试试这里的算法, 在我的测试中效果还不错.

@witgo
Copy link
Contributor

witgo commented Aug 14, 2016

似乎有一些bug ,我跑的结果不太对:


Training loss : 3.7500901095175676
Training loss : 3.6481977670037447
Training loss : 3.0154451631968673
Training loss : 2.301574750976185
Training loss : 1.64470397565321
(Iteration 5/1000) Test RMSE:                     1.233504
Training loss : 1.2284820306510036
Training loss : 1.4732805597950736
Training loss : 1.1205931927870145
Training loss : 0.9359770573525823
Training loss : 0.9216058314346698
(Iteration 10/1000) Test RMSE:                     0.925369
Training loss : 0.913410135170783
Training loss : 1.1816797199323703
Training loss : 1.651559537221694
Training loss : 1.1079543313491855
Training loss : 0.9330512755211859
(Iteration 15/1000) Test RMSE:                     0.933812
Training loss : 0.91655996522135
Training loss : 1.3159227421256716
Training loss : 1.4240307849058782
Training loss : 1.105259133711867
Training loss : 0.9165354277926252
(Iteration 20/1000) Test RMSE:                     0.919473
Training loss : 0.9028139663645766
Training loss : 1.3253980953053717
Training loss : 1.350138999697169
Training loss : 0.9381364146316845
Training loss : 0.902270442685908
(Iteration 25/1000) Test RMSE:                     0.910946
Training loss : 0.8880398655525505
Training loss : 1.2689394561424192
Training loss : 1.3283529096666535
Training loss : 1.0666820486691853
Training loss : 0.8905154300146964
(Iteration 30/1000) Test RMSE:                     0.901018
Training loss : 0.8713604279066419
Training loss : 1.3965301563797694
Training loss : 1.2681387865382572
Training loss : 0.8955762717430986
Training loss : 0.8638836408180803
(Iteration 35/1000) Test RMSE:                     0.892930
Training loss : 0.8515089350824213
Training loss : 1.236073300499966
Training loss : 1.3715636757285579
Training loss : 1.0443572333235276
Training loss : 0.860208250298429
(Iteration 40/1000) Test RMSE:                     0.893269
Training loss : 0.8388994489050412
Training loss : 1.3173294754531584
Training loss : 1.3666662175047999
Training loss : 0.8870536556003747
Training loss : 0.8364603386191529
(Iteration 45/1000) Test RMSE:                     0.889765
Training loss : 0.8201107027514734
Training loss : 1.2157862845113319
Training loss : 1.3496795985855927
Training loss : 1.002764761280667
Training loss : 0.831910395941351
(Iteration 50/1000) Test RMSE:                     0.894383

@MetaFlowRepo
Copy link
Contributor

Haipeng, would you please take a look?

Get Outlook for iOS

On Sat, Aug 13, 2016 at 10:07 PM -0700, "Guoqiang Li" notifications@github.com wrote:

似乎有一些bug ,我跑的结果不太对:


Training loss : 3.7500901095175676
Training loss : 3.6481977670037447
Training loss : 3.0154451631968673
Training loss : 2.301574750976185
Training loss : 1.64470397565321
(Iteration 5/1000) Test RMSE:                     1.233504
Training loss : 1.2284820306510036
Training loss : 1.4732805597950736
Training loss : 1.1205931927870145
Training loss : 0.9359770573525823
Training loss : 0.9216058314346698
(Iteration 10/1000) Test RMSE:                     0.925369
Training loss : 0.913410135170783
Training loss : 1.1816797199323703
Training loss : 1.651559537221694
Training loss : 1.1079543313491855
Training loss : 0.9330512755211859
(Iteration 15/1000) Test RMSE:                     0.933812
Training loss : 0.91655996522135
Training loss : 1.3159227421256716
Training loss : 1.4240307849058782
Training loss : 1.105259133711867
Training loss : 0.9165354277926252
(Iteration 20/1000) Test RMSE:                     0.919473
Training loss : 0.9028139663645766
Training loss : 1.3253980953053717
Training loss : 1.350138999697169
Training loss : 0.9381364146316845
Training loss : 0.902270442685908
(Iteration 25/1000) Test RMSE:                     0.910946
Training loss : 0.8880398655525505
Training loss : 1.2689394561424192
Training loss : 1.3283529096666535
Training loss : 1.0666820486691853
Training loss : 0.8905154300146964
(Iteration 30/1000) Test RMSE:                     0.901018
Training loss : 0.8713604279066419
Training loss : 1.3965301563797694
Training loss : 1.2681387865382572
Training loss : 0.8955762717430986
Training loss : 0.8638836408180803
(Iteration 35/1000) Test RMSE:                     0.892930
Training loss : 0.8515089350824213
Training loss : 1.236073300499966
Training loss : 1.3715636757285579
Training loss : 1.0443572333235276
Training loss : 0.860208250298429
(Iteration 40/1000) Test RMSE:                     0.893269
Training loss : 0.8388994489050412
Training loss : 1.3173294754531584
Training loss : 1.3666662175047999
Training loss : 0.8870536556003747
Training loss : 0.8364603386191529
(Iteration 45/1000) Test RMSE:                     0.889765
Training loss : 0.8201107027514734
Training loss : 1.2157862845113319
Training loss : 1.3496795985855927
Training loss : 1.002764761280667
Training loss : 0.831910395941351
(Iteration 50/1000) Test RMSE:                     0.894383

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#61 (comment)

extDataSet.count()

def run(iterations: Int): Unit = {
var his = Array.fill(featureSize + views.length, rank)(0.0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以移到外面.放到类里面像这样:

@transient private lazy val his = Array.fill(featureSize + views.length, rank)(0D)

@witgo
Copy link
Contributor

witgo commented Aug 14, 2016

可以看下我测试的分支:
https://github.com/witgo/zen/tree/vecMVM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants