Comments (6)
Hi Marc,
Thanks for bringing this up! This is indeed a bug, and we are fixing it.
from deeprec.
Hi Marc,
Upon checking, this is not a bug. When applying BatchNorm on the default axis (last dim), BatchNorm reduces to LayerNorm, and since the size of gamma/beta depends on the shape of input tensor, the original implementation is still correct.
However, for the clarity of the code, we updated the example (ref PR #816 ).
Thanks for the comment!
from deeprec.
I am not sure I am following see this screenshot.
What am I missing?
from deeprec.
Because your code isn't in trianing.
tf.layers.batch_normalization()
will call to class BatchNormalizationBase
tf.keras.layers.LayerNormalization()
will call to class LayerNormalization
In LayerNormalization, mean and var are computed by nn.moments
then use
nn.batch_normalization
to get the result.DeepRec/tensorflow/python/keras/layers/normalization.py
Lines 1040 to 1046 in 6bd822e
It is the same with BN without other features.
DeepRec/tensorflow/python/keras/layers/normalization.py
Lines 643 to 652 in 6bd822e
DeepRec/tensorflow/python/keras/layers/normalization.py
Lines 736 to 739 in 6bd822e
DeepRec/tensorflow/python/keras/layers/normalization.py
Lines 820 to 825 in 6bd822e
But the difference is that when you are not in training, the mean and var of BN will be replaced.
DeepRec/tensorflow/python/keras/layers/normalization.py
Lines 744 to 750 in 6bd822e
from deeprec.
you can add input param moving_mean_initializer='ones'
which is defaulted to 'zeros' and find output is changed.
from deeprec.
Thanks @Duyi-Wang it makes sense. I was confused by it as well but the doc clearly state it. Thanks for pointing out the code.
Adding a screenshot for posterity.
Feel free to close this one.
from deeprec.
Related Issues (20)
- [DLRM]dst pointer is not actually on GPU HOT 1
- [Doc] Contributer CLA link has expired HOT 1
- Documents regarding "Getting Started" and "Best Practices" are needed.
- No OpKernel was registered to support Op 'PreprocessingForward' Error for Multi Machine, Multi GPU
- How to use workqueue? HOT 1
- multi-machine, multi-gpu sok core dump HOT 2
- feature_column.sparse_column_wth_embedding wrong name HOT 2
- crosstool_wrapper_driver_is_not_gcc 【 builf failed】 HOT 1
- DeepRec support cuda 10 HOT 1
- Why CUDA Graph could not be enabled in training process? HOT 1
- r1.15.5-deeprec2302版编译报错 HOT 1
- 配合EasyRec报错 HOT 2
- test Failure for TEST_F(OptimizerFusionTest, LSTMControlInputs) in optimizer_fusion_engine_test.cc
- 使用deeprec的estimator分布式训练ps节点core dump HOT 1
- Error when running DIN using --multihash=True
- cpu版本release镜像coredump问题 HOT 2
- ParseBatchRequestFromBuf 报错
- [SOK] LookupOrCreate in lookup_adapter has no matched func in embedding var? HOT 3
- Cannot place the graph because a reference or resource edge connects colocation groups with incompatible resource devices HOT 3
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 deeprec.