Skip to content

Brings some colour to the boring `nn` package of Torch.

Notifications You must be signed in to change notification settings

Atcold/torch-pretty-nn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pretty-nn

pretty-nn package brings some colour to the boring nn package of Torch.

Installation

luarocks install pretty-nn

Usage

Say we have the following model

c = nn.Parallel(1,2)
for i = 1, 3 do
   local t = nn.Sequential()
   t:add(nn.Linear(4, 2))
   t:add(nn.Reshape(2, 1))
   c:add(t)
end
split = nn.Concat(2)
split:add(c)
block = nn.Sequential()
block:add(nn.View(-1))
block:add(nn.Linear(12, 4))
block:add(nn.View(2, 2))
split:add(block)

If we print it on screen with print(split) we get something like this

Boring

If we require 'pretty-nn' and print(split) again, we'll get this

Cool

You can toggle the prettiness with yourModelName:prettyPrint(). Alternative, you can enable / disable it by yourModelName:prettyPrint(true / false).

About

Brings some colour to the boring `nn` package of Torch.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages