CLIPig supports expressions for all parameters. Some parameters also support variables and the expression will be evaluated every time the value is needed.
E.g., if you want thrice the CLIP-resolution of 224x224 pixels but have reasons to not calculate it, just say:
resolution: 224*3
Note: Parameters that expect lists (like resolution above) copy a single value to all entries of the list. A list can be specified with
- YAML syntax:
resolution: - 640 - 480- with commas:
resolution: 640, 480- or simply with spaces
resolution: 640 480If you type expressions, you might want to use spaces or commas. In case of list parameters you'll need to use the YAML lists:
resolution: - 224 * 3 - pow(224, 1.2)
The result of an expression is automatically converted to
the desired type. So even if your resolution
expression
generates a float it will be cast to integer before being used.
Note: Divisions through zero and stuff like this will throw an error and stop the experiment.
Holds variables that reference the current training time.
type: int
The current epoch / frame, starting at zero.
type: float
The current epoch / frame divided by the number of epochs, or in other words: A float ranging from 0.0 (start of training) to 1.0 (end of training).
type: float
One minus the current epoch / frame divided by the number of epochs, or in other words: A float ranging from 1.0 (start of training) to 0.0 (end of training).
type: function(float, float)
A function that returns a float in the range [0, 1] during the time interval defined by the two values.
time_step(0, 1) # increases from zero to one during whole training
time_step(0.5, 1) # increases from zero to one during second half of training
time_step(0.5, 0) # decreases from one to zero during first half of training
Holds the resolution of the training image.
type: [int, int]
The resolution of the training image as list of width and height.
type: int
The width of the training image.
type: int
The width of the training image.
The current values of learnrate and learnrate_scale which can be expressions themselves.
type: float
The currently used learnrate
type: float
The currently used learnrate_scale
Variables available to target features
type: float
The cosine similarity of the CLIP-representation of the current, transformed image area with the desired feature.
The value is in the range [-100, 100].
Variables available to constraints
type: float
The mean of all cosine similarities of the CLIP-representation of the current, transformed image area with the desired features of this target.
The value is in the range [-100, 100].