mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-08-22 06:23:20 -07:00
fix num_labels type
This commit is contained in:
parent
faf2a4a885
commit
86c7618c07
1 changed files with 2 additions and 1 deletions
|
@ -503,8 +503,9 @@ Examples: df, liae, df-d, df-ud, liae-ud, ...
|
||||||
|
|
||||||
def get_smooth_noisy_labels(label, tensor, smoothing=0.2, noise=0.05):
|
def get_smooth_noisy_labels(label, tensor, smoothing=0.2, noise=0.05):
|
||||||
num_labels = self.batch_size
|
num_labels = self.batch_size
|
||||||
for d in tensor.shape[1:]:
|
for d in tensor.get_shape().as_list()[1:]:
|
||||||
num_labels *= d
|
num_labels *= d
|
||||||
|
# num_labels = int(num_labels)
|
||||||
probs = tf.math.log([[noise, 1-noise]]) if label == 1 else tf.math.log([[1-noise, noise]])
|
probs = tf.math.log([[noise, 1-noise]]) if label == 1 else tf.math.log([[1-noise, noise]])
|
||||||
x = tf.random.categorical(probs, num_labels)
|
x = tf.random.categorical(probs, num_labels)
|
||||||
x = tf.cast(x, tf.float32)
|
x = tf.cast(x, tf.float32)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue