Tensorboard - pai-plznw4me/tensorflow_basic GitHub Wiki
tf.Module κ³Ό Tensorboard μκ°ν
μ¬μ© ν¨ν΄ 3
: λ³μ(tf.Variable) μ κ³μΈ΅μ μΈ μ΄λ¦μ λΆμ¬ν λ
@tf.Module.with_name_scope
μ method μ μ¬μ©ν΄ μ΄λ¦μ λΆμ¬
- tensor, operator μ group νν΄ μκ°ν ν μ
- κ³μΈ΅μ μΈ(hierarchies) λ³μ κ΄λ¦¬λ₯Ό νκ³ μΆμ λ
2κ°μ§ λ°©λ²μ ν΅ν΄ λ³μλ₯Ό κ΄λ¦¬ν μ μλλ°
-
tf.name_scope(name=)
class Dense(tf.Module): def __init__(self, in_features, out_features, name=None): super().__init__(name=name) with tf.name_scope(name=name): self.w = tf.Variable( tf.random.normal([in_features, out_features]), name='w') self.b = tf.Variable(tf.zeros([out_features]), name='b') def __call__(self, x): y = tf.matmul(x, self.w) + self.b return tf.nn.relu(y)
-
tf.Module.name_scope
class MLP(tf.Module): def __init__(self, input_size, sizes, name=None): super(MLP, self).__init__(name=name) self.layers = [] with self.name_scope: for size in sizes: self.layers.append(Dense(input_dim=input_size, output_size=size)) input_size = size @tf.Module.with_name_scope def __call__(self, x): for layer in self.layers: x = layer(x) return x
λ³μλ§ λ¬Άμ κ±΄μ§ μ°μ°μ κΉμ§ λͺ¨λ name_scope μ λ¬Άμκ±΄μ§ κ²°μ ν μ μλ€.
λ€λ§ ν΄λΉ λ°©λ²μ λͺ¨λ Module μ΄λ¦μΌλ‘ λ¬Άμ¬μ§λ€λ λ¨μ μ΄ μλ€.
ν΄λΉ μ΄μ λ μ΄λ¦ μμ± μκΈ° λλ¬Έμ΄λ€. μμΈν λ΄μ©μ μλ tensorflow issue μ μ΄ν΄ 보μ