11 2020 档案
摘要:criteria = nn.CrossEntropyLoss() loss = criteria(output, target) loss = torch.nn.functional.cross_entropy(output, target) import torch import torchvis
阅读全文
摘要:检查运行文件名称与模块名称是否重复。如果重复,需要将文件名称重新命名。
阅读全文
摘要:a = np.r_[1:4,0,4] print(a) [1 2 3 0 4]
阅读全文
摘要:import tensorflow as tf inputs = tf.random.normal([32, 10, 8]) lstm = tf.keras.layers.LSTM(4) output = lstm(inputs) print(output.shape) lstm = tf.kera
阅读全文
摘要:import numpy as np # from tensorflow import keras X = np.random.randint(100, size=10*1000).reshape(1000, 10) Y = np.random.randint(100, size=15*1000).
阅读全文
摘要:import torch from torch import nn from torch.utils.tensorboard import SummaryWriter '''https://zhuanlan.zhihu.com/p/242086547''' a = torch.Tensor([[1,
阅读全文
摘要:import tensorflow as tf import numpy as np # a = tf.random.uniform([2, 1, 2, 3]) # b = tf.random.uniform([1, 3, 3, 2]) # c = tf.matmul(a, b) '''https:
阅读全文

浙公网安备 33010602011771号