From 78f85fcfa424a2473f20acd7dc654b055f63fd01 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Thu, 15 Sep 2016 15:39:49 +0100 Subject: [PATCH] compiles on valhalla and doesn't segfault --- src/sgd.cu | 4 +++- src/sgd.h | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/sgd.cu b/src/sgd.cu index d46ece86..f864e6db 100644 --- a/src/sgd.cu +++ b/src/sgd.cu @@ -1,3 +1,4 @@ +#include #include #include #include "sgd.h" @@ -32,7 +33,8 @@ void SGD::Run() Tensor xt({(int)maxBatchSize_, (int)numExamples}, 0.0f); Tensor yt({(int)maxBatchSize_, (int)numClasses_}, 0.0f); - vector shuffle = CreateShuffle(numExamples); + //vector shuffle = CreateShuffle(numExamples); + vector shuffle; for (size_t numEpoch = 0; numEpoch < epochs_; ++numEpoch) { std::cerr << "Starting epoch #" << numEpoch << std::endl; diff --git a/src/sgd.h b/src/sgd.h index c5ea8dbc..33364049 100644 --- a/src/sgd.h +++ b/src/sgd.h @@ -20,9 +20,9 @@ class SGD { void Run(); private: - std::shared_ptr cost_function_; - std::shared_ptr inX_; - std::shared_ptr inY_; + Expr *cost_function_; + Expr *inX_; + Expr *inY_; std::vector params_; const float eta_; std::vector& xData_;