Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
hmd101 committed Jul 10, 2024
1 parent 2b8203a commit e431a8e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/Metamer-Portilla-Simoncelli.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -499,13 +499,13 @@
"\n",
"- Marginal Statistics. These include pixel statistics (mean, variance, skew, kurtosis, and range of the pixel values), as well as the skewness and kurtosis of the lowpass images computed at each level of the recursive pyramid decomposition.\n",
"- Auto-Correlation Statistics. These include the auto-correlation of the real-valued pyramid bands, as well as the auto-correlation of the magnitude of the pyramid bands, and the mean of the magnitude of the pyramid bands.\n",
"- Cross-Correlation Statistics. These include correlations across scale and across orientation bands of the pyramid (both for the real values of the pyramid and the magnitude of the pyramid bands).\n",
"- Cross-Correlation Statistics. These include correlations across scale and across orientation bands of the pyramid (both for the real values of the pyramid and for the magnitude of the pyramid bands).\n",
"\n",
"The original paper uses synthesis to demonstrate the role of these different types of statistics. They show that the statistics can be used to constrain a synthesis optimization to generate new examples of textures. They also show that the absence of subsets of statistics results in synthesis failures. Here we replicate those results.\n",
"\n",
"The first step is to create a version of the Portilla Simoncelli model where certain statistics can be turned off.\n",
"\n",
"There are two important implementation details here, which you might be interested in if you'd like to write a similar extension of this model, and they both relate to coarse-to-fine synthesis. When removing statistics from the model, the most natural implementation would be to to remove them from the model's representation, changing the shape of the returned tensor. However, in order for coarse-to-fine synthesis to work, we need to know which scale each statistic aligns with, and changing the shape destroys that mapping. Therefore, the proper way to remove statistics (in order to remain compatible with coarse-to-fine optimization) is to zero out those statistics instead: directly setting them to zero breaks the gradient so that they have no impact on the synthesis procedure. The second detail is that, during coarse-to-fine optimization, we must remove some set of statistics, which we do by calling the `remove_scales` method at the *end* of the function call. See the `forward` call below for an example of this"
"There are two important implementation details here, which you might be interested in if you'd like to write a similar extension of this model, and they both relate to coarse-to-fine synthesis. When removing statistics from the model, the most natural implementation would be to remove them from the model's representation, changing the shape of the returned tensor. However, in order for coarse-to-fine synthesis to work, we need to know which scale each statistic aligns with, and changing the shape destroys that mapping. Therefore, the proper way to remove statistics (in order to remain compatible with coarse-to-fine optimization) is to zero out those statistics instead: directly setting them to zero breaks the gradient so that they have no impact on the synthesis procedure. The second detail is that, during coarse-to-fine optimization, we must remove some set of statistics, which we do by calling the `remove_scales` method at the *end* of the function call. See the `forward` call below for an example of this"
]
},
{
Expand Down Expand Up @@ -566,7 +566,7 @@
" 3d tensor of shape (batch, channel, stats) containing the measured texture stats.\n",
"\n",
" \"\"\"\n",
" # create the representation tensor with (with all scales)\n",
" # create the representation tensor (with all scales)\n",
" stats_vec = super().forward(image)\n",
" # convert to dict so it's easy to zero out the keys we don't care about\n",
" stats_dict = self.convert_to_dict(stats_vec)\n",
Expand Down Expand Up @@ -2164,7 +2164,7 @@
"kernelspec": {
"display_name": "plenoptic",
"language": "python",
"name": "plenoptic"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -2176,7 +2176,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.0"
"version": "3.10.10"
}
},
"nbformat": 4,
Expand Down

0 comments on commit e431a8e

Please sign in to comment.