arnab39 / equiadapt Goto Github PK
View Code? Open in Web Editor NEWLibrary to make any existing neural network architecture equivariant
Home Page: https://equiadapt.readthedocs.io
License: MIT License
Library to make any existing neural network architecture equivariant
Home Page: https://equiadapt.readthedocs.io
License: MIT License
Hello,
Firstly, I would like to express my admiration for your work on this project. It has been a great resource for the community.
I have a question regarding the implementation of the "invert_canonicalization" function. In both the paper and the code, you have provided this function to invert the rotation of the outputs after canonicalization for the prediction network. However, in the example of image segmentation, it seems that you have only used the "canonicalize" function by rotating the target (https://github.com/arnab39/equiadapt/blob/main/examples/images/segmentation/model.py#L121), without utilizing the "invert_canonicalization" function. Could you please clarify why the "invert_canonicalization" function is not required in this instance?
Thank you for your time and assistance. I look forward to your response.
I am using python version 3.8.10 on Ubuntu. I tried installing with pip install -e .
and got the following error:
pip install -e .
Obtaining file:///home/danibene/dev/EquivariantAdaptation
Installing build dependencies ... done
Checking if build backend supports build_editable ... done
Getting requirements to build editable ... done
Installing backend dependencies ... done
Preparing editable metadata (pyproject.toml) ... done
Collecting torch (from equiadapt==0.1.0)
Downloading torch-2.2.1-cp38-cp38-manylinux1_x86_64.whl.metadata (25 kB)
Collecting numpy (from equiadapt==0.1.0)
Downloading numpy-1.24.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (5.6 kB)
Collecting torchvision (from equiadapt==0.1.0)
Downloading torchvision-0.17.1-cp38-cp38-manylinux1_x86_64.whl.metadata (6.6 kB)
Collecting kornia (from equiadapt==0.1.0)
Using cached kornia-0.7.1-py2.py3-none-any.whl.metadata (12 kB)
Collecting escnn (from equiadapt==0.1.0)
Downloading escnn-1.0.11-py3-none-any.whl.metadata (19 kB)
Collecting scipy (from escnn->equiadapt==0.1.0)
Downloading scipy-1.10.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (58 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.9/58.9 kB 2.6 MB/s eta 0:00:00
Collecting lie-learn (from escnn->equiadapt==0.1.0)
Downloading lie_learn-0.0.1.post1-cp38-cp38-manylinux1_x86_64.whl (16.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.6/16.6 MB 4.0 MB/s eta 0:00:00
Collecting joblib (from escnn->equiadapt==0.1.0)
Using cached joblib-1.3.2-py3-none-any.whl.metadata (5.4 kB)
Collecting pymanopt (from escnn->equiadapt==0.1.0)
Downloading pymanopt-2.2.0-py3-none-any.whl.metadata (7.0 kB)
Collecting autograd (from escnn->equiadapt==0.1.0)
Downloading autograd-1.6.2-py3-none-any.whl.metadata (706 bytes)
Collecting py3nj (from escnn->equiadapt==0.1.0)
Downloading py3nj-0.2.1.tar.gz (49 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 50.0/50.0 kB 3.4 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [27 lines of output]
+ meson setup /tmp/pip-install-ebb6c36w/py3nj_fa03e97b2b054d2ba2b257c6d1531242 /tmp/pip-install-ebb6c36w/py3nj_fa03e97b2b054d2ba2b257c6d1531242/.mesonpy-4yh1y07p -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/tmp/pip-install-ebb6c36w/py3nj_fa03e97b2b054d2ba2b257c6d1531242/.mesonpy-4yh1y07p/meson-python-native-file.ini
The Meson build system
Version: 1.3.2
Source dir: /tmp/pip-install-ebb6c36w/py3nj_fa03e97b2b054d2ba2b257c6d1531242
Build dir: /tmp/pip-install-ebb6c36w/py3nj_fa03e97b2b054d2ba2b257c6d1531242/.mesonpy-4yh1y07p
Build type: native build
Project name: py3nj
Project version: 0.2.1
../meson.build:1:0: ERROR: Unknown compiler(s): [['gfortran'], ['flang'], ['nvfortran'], ['pgfortran'], ['ifort'], ['ifx'], ['g95']]
The following exception(s) were encountered:
Running `gfortran --version` gave "[Errno 2] No such file or directory: 'gfortran'"
Running `gfortran -V` gave "[Errno 2] No such file or directory: 'gfortran'"
Running `flang --version` gave "[Errno 2] No such file or directory: 'flang'"
Running `flang -V` gave "[Errno 2] No such file or directory: 'flang'"
Running `nvfortran --version` gave "[Errno 2] No such file or directory: 'nvfortran'"
Running `nvfortran -V` gave "[Errno 2] No such file or directory: 'nvfortran'"
Running `pgfortran --version` gave "[Errno 2] No such file or directory: 'pgfortran'"
Running `pgfortran -V` gave "[Errno 2] No such file or directory: 'pgfortran'"
Running `ifort --version` gave "[Errno 2] No such file or directory: 'ifort'"
Running `ifort -V` gave "[Errno 2] No such file or directory: 'ifort'"
Running `ifx --version` gave "[Errno 2] No such file or directory: 'ifx'"
Running `ifx -V` gave "[Errno 2] No such file or directory: 'ifx'"
Running `g95 --version` gave "[Errno 2] No such file or directory: 'g95'"
Running `g95 -V` gave "[Errno 2] No such file or directory: 'g95'"
A full log can be found at /tmp/pip-install-ebb6c36w/py3nj_fa03e97b2b054d2ba2b257c6d1531242/.mesonpy-4yh1y07p/meson-logs/meson-log.txt
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Hello all,
Thanks for sharing such amazing work! I'm very interested in using and implementing your code, particularly for equivariant tasks.
For learning to use your library, I've been playing around with your notebook under tutorials/images/understanding_discrete_canonicalization.ipynb. The notebook is very straightforward and easy to understand, so congrats for that :)
As a step further, I tried to add the function invert_canonicalization to play with it as follows:
for image in train_loader_tqdm:
image = image.to(device)
canonicalized_image = canonicalizer.canonicalize(image)
outputs = canonicalizer.invert_canonicalization(canonicalized_image)
[...]
When doing this, some problems and questions were raised:
get_action_on_image_features
under /images/utils.py
:
feature_map. shape [1]
need to be multiple of num_group
? In this example, these dimensions are 3 and 4, respectively. However, with that requirement, the image's channel size would have to be 4 or 8, for example. As far as I understand, this function reverses the canonicalization, that is, rotates the image by a certain angle. So why is the expected dimension different than that of the image? Have I misunderstood what this function is aiming to do?prediction_network
(not used in this particular example but exemplified in your README) has a different shape than the input required by the prediction_network
? For example, the input is an image, and the output is a vector. In that case, we'd like to apply the rotation action to the vector instead of an input image. Do you store the canonicalization (or inverse canonicalization) transform somewhere so that it can be applied to whichever data shape? I've seen that you have a list of angles under group_element_dict["group_element"]["rotation"]
; however, I don't quite understand what these angles represent. Shouldn't it be just one angle?Thank you so much :)
Olaya
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.