This commit is contained in:
Hieu Hoang 2016-09-13 14:32:25 +02:00
parent c05b18071a
commit 7b9555b1de
2 changed files with 8 additions and 7 deletions

View File

@ -24,6 +24,7 @@ Exporting some paths for CuDNN may be required (put it, for example, in your `.b
Compilation with `cmake > 3.5`:
mkdir build
cd build
cmake ..
make -j

View File

@ -6,14 +6,14 @@ int main(int argc, char** argv) {
using namespace marian;
using namespace keywords;
auto x = input(shape={whatevs, 784}, name="X");
auto y = input(shape={whatevs, 10}, name="Y");
Expr x = input(shape={whatevs, 784}, name="X");
Expr y = input(shape={whatevs, 10}, name="Y");
auto w = param(shape={784, 10}, name="W0");
auto b = param(shape={1, 10}, name="b0");
Expr w = param(shape={784, 10}, name="W0");
Expr b = param(shape={1, 10}, name="b0");
auto lr = softmax(dot(x, w) + b, axis=1, name="pred");
auto graph = -mean(sum(y * log(lr), axis=1), axis=0, name="cost");
Expr lr = softmax(dot(x, w) + b, axis=1, name="pred");
Expr graph = -mean(sum(y * log(lr), axis=1), axis=0, name="cost");
Tensor tx({500, 784}, 1);
Tensor ty({500, 10}, 1);
@ -46,4 +46,4 @@ int main(int argc, char** argv) {
//opt.run();
return 0;
}
}