Comments (5)
I agree with you. I will try more to improve efficiency.
Anyway, thank you for your well-organized code and detailed reply.
This project helps me a lot.
Best,
Yoking
from e2cnn.
Hi @yokinglou
Let me understand exactly what you need to do.
I see three different cases.
-
the S images need to be processed independently using the same weights. Then you can just reshape to (B*S, C, H, W) pushing them in the batch dimension
-
the S images are just additional features which can and need to be processed together. The you can reshape the input to (B, S*C, H, W). In our library, you need to define the
FieldType
asS
times larger. Suppose that an image (one of the S images) has FieldType
gs = e2cnn.gspaces.Rot2dOnR2(8)
ft = e2cnn.nn.FieldType(gs, [gs.regular_repr]*3)
then your (reshaped) input can have field type
ft_S = e2cnn.nn.FieldType(gs, [gs.regular_repr]*3 * S)
Then, you can use the R2Conv as usual.
- the S images are additional features but they need to be processed independently, i.e. they are processed by their own set of filters and their outputs are independent. You can do this using grouped convolution.
You do this by using R2Conv and the FieldType like above in 2). However, when you build R2Conv, you need to set the parametergroups=S
.
Does this answer your question?
If not, could you provide how you would implement the operation you would like in PyTorch?
I can then help you implement it in our library
Best,
Gabriele
from e2cnn.
Hi Gabriele
Thanks for your detailed reply! I think the first case is what I want to do.
I have tried to reshape the tensor to (B*S, C, H, W) and send it to the network to get the invariant feature (B*S, C'). Reshape the feature back to (B, S, C') at last.
Here is a problem. The occupied memory on the GPU is too large when I increase the S. One way is reducing the batch size to release the occupation while this is not expected.
Is there any way to improve memory efficiency without losing the information included in the original input?
Thanks,
Yoking
from e2cnn.
Hi @yokinglou
I think this is an expected behaviour, as you are effectively increasing the batch size.
What is the meaning of the S images?
From what I have understood, these are just additional images in the batch, right?
I feel like this issues is not really related to our library, but rather to some design choice in your experiments.
Have I misunderstood something?
Unfortunately, I am not sure I understand what you mean in your last question.
Best,
Gabriele
from e2cnn.
Hi @yokinglou ,
I am happy to read this! Thanks!
Please, let me know if you encounter any other issues :)
Best,
Gabriele
from e2cnn.
Related Issues (20)
- wrapping pytorch operations - grid_sample HOT 4
- Import Error with Torch 1.9.0+cu111 HOT 2
- equivariant Transformer HOT 5
- ZeroPad2D on GeometricTensor
- Cannot pass weights of R2Conv as a positional argument HOT 2
- Counting FLOPs for e2cnn HOT 1
- equivariance in C8 space HOT 1
- Module export HOT 3
- About the equivalence of wide_resnet HOT 5
- Need a size parameter for e2cnn.R2Upsampling Class HOT 1
- about attribute R2conv.filter HOT 2
- Learning of kernels HOT 2
- O(2) group, irreps, and PyTorch DDP. HOT 2
- checking equivariance for the angles that are not 90n HOT 2
- about to set special rotation equivariant HOT 2
- Cannot import name container_abcs in python 3.6 version (e2cnn_py36)
- shriking size of output image
- Use of np.float and np.int etc
- Difference between trivial output type and regular output type with group pooling HOT 1
- Export Linear HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from e2cnn.