Skip to content

Commit

Permalink
Merge pull request #1 from jcjohnson/master
Browse files Browse the repository at this point in the history
Sync to original
  • Loading branch information
htoyryla authored Oct 21, 2016
2 parents 616746b + b9c267c commit c445481
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
7 changes: 6 additions & 1 deletion fast_neural_style/GramMatrix.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ Output:

function Gram:__init(normalize)
parent.__init(self)
self.normalize = normalize or true
if normalize ~= nil then
assert(type(normalize) == 'boolean', 'normalize has to be true/false')
self.normalize = normalize
else
self.normalize = true
end
self.buffer = torch.Tensor()
end

Expand Down
2 changes: 1 addition & 1 deletion fast_neural_style/PerceptualCriterion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function crit:__init(args)
-- Set up style loss layers
for i, layer_string in ipairs(args.style_layers) do
local weight = args.style_weights[i]
local style_loss_layer = nn.StyleLoss(weight, args.loss_type)
local style_loss_layer = nn.StyleLoss(weight, args.loss_type, args.agg_type)
layer_utils.insert_after(self.net, layer_string, style_loss_layer)
table.insert(self.style_loss_layers, style_loss_layer)
end
Expand Down
1 change: 0 additions & 1 deletion train.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'torch'
require 'loadcaffe'
require 'optim'
require 'image'

Expand Down

0 comments on commit c445481

Please sign in to comment.