2 * mlp-mnist is an implementation of a multi-layer neural network.
4 * Copyright (c) 2006 École Polytechnique Fédérale de Lausanne,
7 * Written by Francois Fleuret <francois@fleuret.org>
9 * This file is part of mlp-mnist.
11 * mlp-mnist is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 3 as
13 * published by the Free Software Foundation.
15 * mlp-mnist is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with mlp-mnist. If not, see <http://www.gnu.org/licenses/>.
29 #define ASSERT(x, s) if(!(x)) { std::cerr << "ASSERT FAILED IN " << __FILE__ << ":" << __LINE__ << " [" << (s) << "]\n"; abort(); }
34 const int buffer_size = 1024;
36 typedef float scalar_t;
38 template<class T> T sq(T x) { return x*x; }
40 template<class T> T pos(T x) { if(x < 0) return 0.0; else return x; }
47 int compare_couple(const void *a, const void *b);