From: Francois Fleuret Date: Thu, 12 Jan 2017 20:37:17 +0000 (+0100) Subject: Cosmetics. X-Git-Url: https://ant.fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=da6186a657b7563841416c42336e52937b76d67f;p=dagnn.git Cosmetics. --- diff --git a/test-dagnn.lua b/test-dagnn.lua index 8f92ccf..a41d880 100755 --- a/test-dagnn.lua +++ b/test-dagnn.lua @@ -84,35 +84,31 @@ function printTensorTable(t) end end --- +--> c ----> e --+ --- / / \ --- / / \ --- input --> a --> b ---> d ----+ g --> output --- \ / --- \ / --- +--> f ---+ +-- +- Linear(10, 10) -> ReLU ---> d --+ +-- / / \ +-- / / \ +-- --> a --> b -----------> c --------------+ e --> +-- \ / +-- \ / +-- +-- Mul(-1) --------+ + +model = nn.DAG() a = nn.Linear(50, 10) b = nn.ReLU() c = nn.Linear(10, 15) -d = nn.Linear(10, 15) -e = nn.CMulTable() -f = nn.Linear(15, 15) -g = nn.CAddTable() - -model = nn.DAG() +d = nn.CMulTable() +e = nn.CAddTable() model:addEdge(a, b) -model:addEdge(b, nn.Linear(10, 5), nn.ReLU(), nn.Linear(5, 10), c) -model:addEdge(b, d) -model:addEdge(c, e) +model:addEdge(b, nn.Linear(10, 15), nn.ReLU(), d) model:addEdge(d, e) -model:addEdge(d, f) -model:addEdge(e, g) -model:addEdge(f, nn.Mul(-1), g) +model:addEdge(b, c) +model:addEdge(c, d) +model:addEdge(c, nn.Mul(-1), e) model:setInput(a) -model:setOutput(g) +model:setOutput(e) local input = torch.Tensor(30, 50):uniform() local output = model:updateOutput(input):clone()