This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- modified version of @jcjohnson's neural-style | |
-- by @htoyryla 14 May 2017 | |
-- allows exploring th effect of giving emphasis to specific channel(s) in a style layer | |
-- use -style_layers to select layer as usual, using a single layer is recommended | |
-- -style_channels to specify one or more channels to be given emphasis, other channels will be attenuated | |
-- if a channel does not exist in a layer, it is ignored and given a warning | |
-- note: if multiple style layers are used, style_channels setting affects both | |
require 'torch' | |
require 'nn' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- modified by ProGamerGov to select the best content channels, in addition to style channels. | |
-- modified version of @jcjohnson's neural-style | |
-- by @htoyryla 13 Feb 2018 | |
-- allows giving emphasis to nc best channel(s) in each style layer | |
-- use -style_layers to select layer as usual, using a single layer is recommended | |
-- -nc to set how many of the best channels are used per layer | |
-- during target capture, tests the model using the style image | |
-- and selects nc channels with strongest activations to be given emphasis during iterations | |
-- not tested with multiple style images |