Comments (5)
You can use this one.
def weighted_cross_entropy(y_true_cls, y_pred_cls,
training_mask):
# Loss for score Map
epsilon = 10e-8
# assume ratio of positive class is 0.1
beta = 1.0 - 0.1
# turn probabilities back to logits
y_pred_cls = tf.clip_by_value(y_pred_cls, epsilon, 1 - epsilon)
y_pred_cls = tf.log(y_pred_cls / (1. - y_pred_cls))
Ls = (1. - beta) * tf.nn.weighted_cross_entropy_with_logits(targets=y_true_cls, logits=y_pred_cls,
pos_weight=beta / (1. - beta))
Ls = tf.reduce_mean(Ls * training_mask)
tf.summary.scalar('classification_logloss', Ls)
return Ls
from east.
I donot recommend implement xentropylike this, you can use tf.nn.weighted_corss_entropy_with_logits
from east.
I need to implement class-balanced cross entropy function, and combine it with EAST. That's why I'm digging into it !
from east.
So if I want to implement class-balanced xentropy, is it okay to ignore training mask part?
from east.
I 'll try. Thank you very much for the answer!
from east.
Related Issues (20)
- how to avoid symbol or icon
- convert to tensorrt
- ImportError: Python version mismatch: module was compiled for version 3.6, while the interpreter is running version 3.7.
- EAST in tensorflowjs
- PRUNING HOT 1
- Does this model recognize other languages HOT 1
- KeyError: 'verbosity'
- !!!!救救孩子!!!!!10w个epoch一定要都跑完吗???为什么训练到1000左右都没有保存模型????? HOT 1
- What does `geometry` contain?
- Invert links
- 请问我应该从哪里看训练过程中各项的变化
- can we custom train for specific number detection like credit card number
- FileNotFoundError: [WinError 2] The system cannot find the file specified HOT 1
- ModuleNotFoundError: No module named 'lanms.adaptor'
- Not able to install on Mac
- how to modify multigpu_train.py to train on cpu with custom dataset
- cannot import resnetv1
- Pure C version of LANMS
- Is there a rule for training image size? HOT 1
- Is there something better to replace EAST?
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 east.