Browse files

fixed batch bug in slave obj

  • Loading branch information...
1 parent 783f30b commit 95559103fc93b92effaffa2d2fff049679715ffe @amaas committed Jun 27, 2011
Showing with 4 additions and 4 deletions.
  1. +1 −1 lblDmAltMF_rpc.m
  2. +2 −2 slaveLblDmRcErObj.m
  3. +1 −1 slaveLoadBOW.m
View
2 lblDmAltMF_rpc.m
@@ -17,7 +17,7 @@
% load data into worker global state
% loading the first numDocs examples without randomly permuting
-numLoaded=slaveLoadBOW(1:modelParams.NumDocs, modelParams.BowFname, modelParams.DictSize);
+numLoaded=slaveLoadBOW((1:modelParams.NumDocs)', modelParams.BowFname, modelParams.DictSize);
assert(numLoaded == modelParams.NumDocs);
% pass modelParams to worker global state
View
4 slaveLblDmRcErObj.m
@@ -44,8 +44,8 @@
% - state.docLen' * full(sum(cur_docBOW .* log(docProbs+eps), 2));
objVal = objVal + docProbObj;
% derivatives are difference of expectations
- % weight docThetas by docLen to handle dot multiply of len for each doc
- cur_docThetaMat = bsxfun(@times, cur_docThetaMat, state.docLen');
+ % weight docThetas by docLen to handle dot multiply of len for each doc
+ cur_docThetaMat = bsxfun(@times, cur_docThetaMat, cur_docLen');
objGrad(rcIndex) = objGrad(rcIndex) - ...
reshape((cur_docThetaMat * cur_docBOW - cur_docThetaMat * docProbs)', [], 1);
% bias derivative is just the word probabilities
View
2 slaveLoadBOW.m
@@ -12,7 +12,7 @@
% trim number of docs, or select specific indices
% ignore top 50 words as they're much more frequent (power/zipf law)
data_docBOW = data_docBOW(:,51:(vocabSize+50));
-% remove docs with 0 counts
+% remove docs with few tags
data_docBOW = data_docBOW(sum(data_docBOW,2)>2,:);
data_docBOW = data_docBOW(docInd,:);

0 comments on commit 9555910

Please sign in to comment.