From cc4e24b3a6fe2ece4709bae1851f9589de7eab7d Mon Sep 17 00:00:00 2001 From: Marcin Junczys-Dowmunt Date: Wed, 14 Sep 2016 23:41:44 +0200 Subject: [PATCH] fixed begin/end in Tensor class --- src/tensor.h | 8 ++++---- src/validate_mnist.cu | 8 +------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/tensor.h b/src/tensor.h index 66690427..40bca4f8 100644 --- a/src/tensor.h +++ b/src/tensor.h @@ -178,12 +178,12 @@ class Tensor { return pimpl_->begin(); } - auto end() -> decltype( pimpl_->begin() ) { - return pimpl_->begin(); + auto end() -> decltype( pimpl_->end() ) { + return pimpl_->end(); } - auto end() const -> decltype( pimpl_->begin() ) { - return pimpl_->begin(); + auto end() const -> decltype( pimpl_->end() ) { + return pimpl_->end(); } const Shape& shape() const { diff --git a/src/validate_mnist.cu b/src/validate_mnist.cu index 56023304..6342a822 100644 --- a/src/validate_mnist.cu +++ b/src/validate_mnist.cu @@ -27,9 +27,9 @@ int main(int argc, char** argv) { Shape wShape, bShape; converter.Load("weights", wData, wShape); converter.Load("bias", bData, bShape); - std::cerr << "Done." << std::endl; + std::cerr << "Building model..."; auto x = input(shape={whatevs, IMAGE_SIZE}, name="X"); auto y = input(shape={whatevs, LABEL_SIZE}, name="Y"); @@ -38,7 +38,6 @@ int main(int argc, char** argv) { auto b = param(shape={1, LABEL_SIZE}, name="b0", init=[bData](Tensor t) {t.set(bData); }); - std::cerr << "Building model..."; auto predict = softmax(dot(x, w) + b, axis=1, name="pred"); auto graph = -mean(sum(y * log(predict), axis=1), @@ -69,11 +68,6 @@ int main(int argc, char** argv) { if (resultsv[i + j] > resultsv[i + predicted]) predicted = j; } acc += (correct == predicted); - //std::cerr << correct << " | " << predicted << " ( "; - //for (size_t j = 0; j < LABEL_SIZE; ++j) { - // std::cerr << resultsv[i+j] << " "; - //} - //std::cerr << ")" << std::endl; } std::cerr << "Accuracy: " << float(acc)/BATCH_SIZE << std::endl;