Skip to content

Commit

Permalink
itorch fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
soumith committed Feb 12, 2015
1 parent 187c16c commit 8d7dc02
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 8 additions & 2 deletions 3_unsupervised/3_train.lua
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,14 @@ for t = 1,params.maxiter,params.batchsize do

-- live display
if params.display then
_win1_ = gfx.image(dd, {win=_win1_, legend='Decoder filters', zoom=2})
_win2_ = gfx.image(de, {win=_win2_, legend='Encoder filters', zoom=2})
if itorch then
print('Decoder filters')
itorch.image(dd)
print('Encoder filters')
itorch.image(de)
else
print('run in itorch for visualization')
end
end

-- save stuff
Expand Down
5 changes: 3 additions & 2 deletions 3_unsupervised/A_kmeans.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

require 'image'
require 'unsup'
require 'gfx.js'

----------------------------------------------------------------------
-- parse command-line options
Expand Down Expand Up @@ -86,7 +85,9 @@ function cb (step,kernels)
for i = 1,params.nkernels do
filters[i] = ks[i]:clone():div(ks[i]:max())
end
gfx.image(filters, {zoom=2, legend='K-Means Centroids'})
if itorch then
itorch.image(filters)
end
end

-- run k-means
Expand Down

0 comments on commit 8d7dc02

Please sign in to comment.