Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/optim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkoray kavukcuoglu <koray@kavukcuoglu.org>2014-04-01 14:03:41 +0400
committerkoray kavukcuoglu <koray@kavukcuoglu.org>2014-04-01 14:03:41 +0400
commit4b29b7b412648a07d4ecb5ef61299ad55b032e29 (patch)
treec75407a6e241e6d6234d48f5eea7a7d0069013bb
parentda5566ac70bd34b36c521ce6857048eea9b3e8f4 (diff)
fix nan handling in polyinterpnanfix
-rw-r--r--polyinterp.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/polyinterp.lua b/polyinterp.lua
index 005243c..2077566 100644
--- a/polyinterp.lua
+++ b/polyinterp.lua
@@ -188,11 +188,13 @@ function optim.polyinterp(points,xminBound,xmaxBound)
-- end
-- end
local cp = torch.cat(Tensor{xminBound,xmaxBound},points[{{},1}])
+ local cpi = zeros(cp:size(1),2)
+ cpi[{ {1,cp:size(1)} , 1 }] = cp
if not nans then
local cproots = roots(dParams)
- local cpi = zeros(cp:size(1),2)
- cpi[{ {1,cp:size(1)} , 1 }] = cp
cp = torch.cat(cpi,cproots,1)
+ else
+ cp = cpi
end
--print(dParams)