摘要:
from tensorflow.keras.callbacks import EarlyStopping import tensorflow as tf import time import numpy as np import matplotlib.pyplot as plt import sys 阅读全文
摘要:
流程图: self-attention: 矩阵运算: Q*K: V*(QK): 整体过程: 阅读全文
摘要:
from tensorflow import keras import tensorflow as tf from tensorflow.keras import layers import numpy as np import os import matplotlib.pyplot as plt 阅读全文
摘要:
(1)没有output_padding: # 当padding="valid"时 new_rows = (rows - 1) * strides[0] + kernel_size[0] new_cols = (cols - 1) * strides[1] + kernel_size[1] # 当pa 阅读全文
摘要:
两个分布的对比(这里是与标准正态分布对比): import tensorflow as tf from tensorflow import keras import numpy as np import matplotlib.pyplot as plt from PIL import Image i 阅读全文
摘要:
import tensorflow as tf from tensorflow import keras import numpy as np import matplotlib.pyplot as plt from PIL import Image import os from tensorflo 阅读全文
摘要:
(x,y),(x_test,y_test) = tf.keras.datasets.cifar10.load_data() x = x/255. x = tf.cast(x,tf.float32) x_test = x_test/255. x_test = tf.cast(x_test,tf.flo 阅读全文
摘要:
# 图像增强 inputs = tf.image.random_flip_left_right(inputs) # 图像随机翻转 inputs = tf.image.random_brightness(inputs,max_delta=0.1) # 图像随机光照 inputs = tf.image. 阅读全文
摘要:
self.conv1 = tf.keras.layers.Conv2D(filter_num, (3, 3), strides=stride, padding='same',kernel_initializer=tf.keras.initializers.he_normal(stddev=0.02) 阅读全文