Skip to content

Instantly share code, notes, and snippets.

-- 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
@ProGamerGov
ProGamerGov / neural-channels.lua
Last active May 18, 2017 22:16 — forked from htoyryla/neural-channels.lua
Neural-style with selected channels emphasis
-- 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'