Comments (8)
It seems that b_IJ will be init to 0 each batch. Or each time when we invoke call function, the b_IJ will be create to 0. I'm not sure whether my opinion is right, I have not use tensorflow for a long time.
b_IJ = tf.constant(np.zeros([1, input.shape[1].value, self.num_outputs, 1, 1], dtype=np.float32))
from capsnet-tensorflow.
@AlexHex7 @pkubik AlexHex7 is right, b_IJ will be re-init to 0 at each batch, it's not shared between batches. Someone(not me) had done experiments about this problem and he told me it does work in that way.
from capsnet-tensorflow.
Oh, sorry @AlexHex7 @naturomics . I didn't formulate it correctly. I meant that it (b_IJ
) is shared between all examples in a single batch. So I'm not sure whether it is correct to share b_IJ
between different examples in the same batch.
from capsnet-tensorflow.
To be more specific what I suggest is to change the initialization of b_IJ
to:
b_IJ = tf.constant(np.zeros([cfg.batch_size, input.shape[1].value, self.num_outputs, 1, 1], dtype=np.float32))
and remove the reduction from the last line of routing inner loop:
b_IJ += u_produce_v
from capsnet-tensorflow.
@pkubik I'm doing a experiment for this problem, please wait for the result of the experiment.
from capsnet-tensorflow.
@pkubik Now, I agree with you, though it makes the number of parameters b_IJ be batch_size-related, and experiment shows it doesn't make much difference. here is a related discussion for this problem, It might help us understand why
from capsnet-tensorflow.
Different sample, different object, different entities, so different b_ij. I'm wondering how much difference it makes@naturomics? Did you make the experiment on minist?
from capsnet-tensorflow.
@Queequeg92 Yeah, I did some experiments on mnist. It doesn't seem to make much difference in terms of classification accuracy. So I didn't release the corresponding result. Maybe trying it on the Fashion-MNIST
that mentioned in issue #20 will see the difference, I will try it soon.
from capsnet-tensorflow.
Related Issues (20)
- Only 10% accuracy for scaled images!!!!! HOT 3
- reshape question
- a question HOT 1
- Question about num_outputs
- Train on different dataset HOT 7
- Using Caps-Net to Handle High-dimensional and Small-sample Problems HOT 1
- I have question about loss function. something wrong, i think....? HOT 3
- Baidu Link Not Working Correctly: Mirror?
- Cannot handle rotation ??? HOT 1
- English Version of Blog HOT 1
- Medical Imaging HOT 7
- Vector Length HOT 3
- About the routing biases HOT 2
- TypeError: 'numpy.ndarray' object is not callable!
- a quesion HOT 1
- about tensorflow c++
- about
- about a problem in gpu_version
- How to save model in SavedModel or frozen_graph format?
- Cap
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 capsnet-tensorflow.