mirror of
https://github.com/marian-nmt/marian.git
synced 2024-11-04 14:04:24 +03:00
tweak
This commit is contained in:
parent
c05b18071a
commit
7b9555b1de
@ -24,6 +24,7 @@ Exporting some paths for CuDNN may be required (put it, for example, in your `.b
|
|||||||
Compilation with `cmake > 3.5`:
|
Compilation with `cmake > 3.5`:
|
||||||
|
|
||||||
mkdir build
|
mkdir build
|
||||||
|
cd build
|
||||||
cmake ..
|
cmake ..
|
||||||
make -j
|
make -j
|
||||||
|
|
||||||
|
12
src/test.cu
12
src/test.cu
@ -6,14 +6,14 @@ int main(int argc, char** argv) {
|
|||||||
using namespace marian;
|
using namespace marian;
|
||||||
using namespace keywords;
|
using namespace keywords;
|
||||||
|
|
||||||
auto x = input(shape={whatevs, 784}, name="X");
|
Expr x = input(shape={whatevs, 784}, name="X");
|
||||||
auto y = input(shape={whatevs, 10}, name="Y");
|
Expr y = input(shape={whatevs, 10}, name="Y");
|
||||||
|
|
||||||
auto w = param(shape={784, 10}, name="W0");
|
Expr w = param(shape={784, 10}, name="W0");
|
||||||
auto b = param(shape={1, 10}, name="b0");
|
Expr b = param(shape={1, 10}, name="b0");
|
||||||
|
|
||||||
auto lr = softmax(dot(x, w) + b, axis=1, name="pred");
|
Expr lr = softmax(dot(x, w) + b, axis=1, name="pred");
|
||||||
auto graph = -mean(sum(y * log(lr), axis=1), axis=0, name="cost");
|
Expr graph = -mean(sum(y * log(lr), axis=1), axis=0, name="cost");
|
||||||
|
|
||||||
Tensor tx({500, 784}, 1);
|
Tensor tx({500, 784}, 1);
|
||||||
Tensor ty({500, 10}, 1);
|
Tensor ty({500, 10}, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user