question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inconsistent documentation in RandomAffine

See original GitHub issue
In [1]: import torchio as tio
tr = t
In [2]: tr = tio.RandomAffine(scales=1.2)

In [3]: tr.scales
Out[3]: (1.2, 1.2)

But the docs say:

If only one value 𝑑 is provided, \s𝑖∼U(0,𝑑).

@GFabien this was introduced in #244. Do you know what’s going on? Also, note that some wrong latex was introduced in that PR, as you can see in that example: the backslash before s in not necessary (https://torchio.readthedocs.io/transforms/augmentation.html#randomaffine). I’ve fixed it in some other places, but some others might still be around.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
GFabiencommented, Aug 25, 2020

Maybe it’d be good to swing around 0 or 1, depending on the parameter. For example, scale or intensity would go around 1, but degrees or translation would be around 0. For example, if you use scale 1.2, it would be converted to 0.8-1.2, not 0-1.2 (which is definitely not a good idea, I think, as if you get e.g. 0.05 your image is pretty much gone.

This makes sense but I fear this would make things too complicated. It is probably clearer to force the user to pass both min and max values…

0reactions
fepegarcommented, Nov 4, 2020

I think it’s fine to use these smart ranges. They use them in torchvision.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RandomAffine — Torchvision main documentation - PyTorch
Random affine transformation of the image keeping center invariant. If the image is torch Tensor, it is expected to have […, H, W]...
Read more >
[FEEDBACK] Transforms V2 API #6753 - pytorch/vision - GitHub
It would be straightforward to document this behavior to users – that ... RandomAffine dispatch to when they operate on a Polygon tensor....
Read more >
Transforms — MONAI 1.1.0 Documentation
This approach allows you to use transforms from otherwise incompatible libraries with ... RandAffineGrid for the random affine parameters configurations.
Read more >
Source code for torchvision.transforms.transforms
[docs]class Compose(object): """Composes several transforms together. ... raise ValueError("tensor and transformation matrix have incompatible shape.
Read more >
Changelog — MMDetection 2.26.0 documentation
v2.25.0 (31/5/2022) · Highlights · Backwards incompatible changes · New Features · Bug Fixes · Improvements · Contributors.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found