production_networks
NetworkDesign
Define what Layers to use for a Neural Style Transfer (NST) Algorithm.
Neural Style Transfer leverages the Layers of an already trained network (ie a VGG Image Model) to extract the style of an image. This class defines what Layers to use for this purpose.
Instances of this class encapsulate the information required to define these Layers for the NST Algorithm.
This information covers 2 aspects of NST: - the Style Layers - the Output Layer.
Style Layers are the ones believed to model the Style the pretrained model has "learned" and are modeled by this class as a sequence of layer (str) IDS paired with a normalized weight.
Output Layer is the layer used to compute the content loss. It is modeled by this class as a single layer (str) ID.
This class is agnostic of the actual Neural Network used for the NST, so it can be used with any Neural Network. Thus, this class's constructor expects to receive a sequence of IDs (str) that represent the available/actual layers of the pretrained model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
network_layers |
Tuple[str]
|
The available/actual layers of the |
required |
style_layers |
Tuple[Tuple[str, float]]
|
Sequence of layer (str) IDS |
required |
output_layer |
str
|
The layer used to compute the content loss. |
required |
Source code in src/artificial_artwork/production_networks/__init__.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|