|
- from torch import nn
- from sklearn.preprocessing import MinMaxScaler
- from sklearn.metrics import mean_squared_error
- import random
- import torch.nn.functional as F
- import numpy as np
- import torch
- from tqdm import tqdm
- from torch.utils.data import Dataset, DataLoader
- import multiprocessing
- import torch.multiprocessing as multiprocess
-
- mm = MinMaxScaler()
-
-
- class ConvNet(nn.Module):
- def __init__(self, input_dim, input_dim1, hidden_dim, kernel_size1, padding1, kernel_size2, padding2, kernel_size3,
- padding3):
- super(ConvNet, self).__init__()
- self.input_dim = input_dim
- self.input_dim1 = input_dim1
-
- self.hidden_dim = hidden_dim
- self.kernel_size1 = kernel_size1
- self.padding1 = padding1
-
- self.kernel_size2 = kernel_size2
- self.kernel_size3 = kernel_size3
- self.padding2 = padding2
- self.padding3 = padding3
- self.gelu = nn.ReLU()
- # stage1
- self.conv1 = nn.Sequential(nn.Conv2d(in_channels=self.input_dim,
- out_channels=16,
- kernel_size=kernel_size1,
- padding=self.padding1,
- ))
- self.conv2 = nn.Sequential(nn.Conv2d(in_channels=16,
- out_channels=32,
- kernel_size=kernel_size2,
- padding=self.padding2,
- ))
- self.conv3 = nn.Sequential(nn.Conv2d(in_channels=32,
- out_channels=1,
- kernel_size=kernel_size3,
- padding=self.padding3,
- ))
- # self.conv4 = nn.Sequential(nn.Conv2d(in_channels=64,
- # out_channels=1,
- # kernel_size=kernel_size,
- # padding=self.padding,
- # ))
- # stage2
- # self.conv11 = nn.Sequential(nn.Conv3d(in_channels=self.input_dim1,
- # out_channels=16,
- # kernel_size=kernel_size1,
- # padding=self.padding1,
- # ),torch.nn.BatchNorm3d(16))
- # self.conv22 = nn.Sequential(nn.Conv3d(in_channels=16,
- # out_channels=32,
- # kernel_size=kernel_size2,
- # padding=self.padding2,
- # ),torch.nn.BatchNorm3d(32))
- # self.conv33 = nn.Sequential(nn.Conv3d(in_channels=32,
- # out_channels=10,
- # kernel_size=kernel_size3,
- # padding=self.padding3,
- # ),torch.nn.BatchNorm3d(10))
- # self.fc = nn.Linear
-
- # 前馈网络过程
- def forward(self, x): # x 为(batch, channel, h, w)
-
- out = self.conv1(x) # x 为(batch, channel, h, w)
- # out = self.gelu(out)
- out = self.conv2(out)
- # out = self.gelu(out)
- out = self.conv3(out)
- # out = self.gelu(out)
- # print('out.shape:{}'.format(out.shape))
- # out1 = out.permute(0,2,1,3,4)
- # out1 = self.conv11(out1)
- # out1 = self.gelu(out1)
- # out1 = self.conv22(out1)
- # out1 = self.gelu(out1)
- # out1 = self.conv33(out1)
- # out1 = self.gelu(out1)
- # out11 = out1.permute(0,2,1,3,4)
- # out = self.conv4(out)
- return out
-
-
- # data = np.load(r'/dataset/7day_for_Nday_data_09_17_atlantic_openi_ICDM_area_last1.npz')
- # data = np.load(r'/dataset/7day_for_Nday_data_09_17_atlantic_openi_ICDM_area_last1.npz')
- for iii in range(1, 6):
-
- data = np.load(r'/dataset/7day_for_Nday_data_openi_09_17_atlantic_area_last.npz')
- # data = np.load(r'/dataset/7day_for_Nday_data_09_17_atlantic_openi_ICDM_area_last11.npz')
- print(
- data.files) # ['hycom_temp', 'slfh', 'sshf', 'ssr', 'str', 'mld', 'analysis_temp', 'u', 'v', 'T_d', 'u_d', 'v_d', 'xx', 'yy']
-
- hycom_temp = data['hycom_temp'][:2000, :, :, :, :] # (3281, 7, 7, 41, 201)
- slfh = data['slfh'][:2000, :, :40, :80] # (3281, 7, 41, 201)
- sshf = data['sshf'][:2000, :, :40, :80] # (3281, 7, 41, 201)
- ssr = data['ssr'][:2000, :, :40, :80] # (3281, 7, 41, 201)
- str = data['str'][:2000, :, :40, :80] # (3281, 7, 41, 201)
- mld = data['mld'][:2000, :, :40, :80] # (3281, 7, 41, 201)
- analysis_temp = data['analysis_temp'][:2000, :, :, :40, :80] # (3281, 7, 7, 41, 201)
- u = data['u'][:2000, :, :, :40, :80] # (3281, 7, 7, 41, 201)
- v = data['v'][:2000, :, :, :40, :80] # (3281, 7, 7, 41, 201)
- T_d = data['T_d'][:2000, :, :40, :80] # (3281, 7, 41, 201)
- u_d = data['u_d'][:2000, :, :40, :80] # (3281, 7, 41, 201)
- v_d = data['v_d'][:2000, :, :40, :80] # (3281, 7, 41, 201)
- xx = data['xx'][:2000, :, :, :] # (3281, 7, 41, 201)
- yy = data['yy'][:2000, :, :, :] # (3281, 7, 41, 201)
- # dT_dt = data['dT_dt'][:,:,:,:40,:80]
- # dT_dx = data['dT_dx'][:,:,:,:40,:80]
- # dT_dy = data['dT_dy'][:,:,:,:40,:80]
- # print('analysis_temp.shape:{}'.format(analysis_temp.shape)) # hycom_temp.shape:(100, 7, 7, 41, 81) batch, deep , time , lat, lon
- # print('T_d.shape:{}'.format(T_d.shape)) # hycom_temp.shape:(100, 7, 7, 41, 81) batch, deep , time , lat, lon
- # print('xx.shape:{}'.format(xx.shape)) # hycom_temp.shape:(100, 7, 7, 41, 81) batch, deep , time , lat, lon
-
- dT_dt_1 = (hycom_temp[:, :, 6, :, :] - hycom_temp[:, :, 0, :, :]) / 6
- dT_dt_2 = (hycom_temp[:, :, 6, :, :] - hycom_temp[:, :, 1, :, :]) / 5
- dT_dt_3 = (hycom_temp[:, :, 6, :, :] - hycom_temp[:, :, 2, :, :]) / 4
- dT_dt_4 = (hycom_temp[:, :, 6, :, :] - hycom_temp[:, :, 3, :, :]) / 3
- dT_dt_5 = (hycom_temp[:, :, 6, :, :] - hycom_temp[:, :, 4, :, :]) / 2
- dT_dt_6 = (hycom_temp[:, :, 6, :, :] - hycom_temp[:, :, 5, :, :]) / 1
-
- dT_dt_1 = dT_dt_1.reshape(-1, 7, 1, 41, 81)
- dT_dt_2 = dT_dt_2.reshape(-1, 7, 1, 41, 81)
- dT_dt_3 = dT_dt_3.reshape(-1, 7, 1, 41, 81)
- dT_dt_4 = dT_dt_4.reshape(-1, 7, 1, 41, 81)
- dT_dt_5 = dT_dt_5.reshape(-1, 7, 1, 41, 81)
- dT_dt_6 = dT_dt_6.reshape(-1, 7, 1, 41, 81)
-
- dT_dt = np.concatenate((dT_dt_1, dT_dt_2, dT_dt_3, dT_dt_4, dT_dt_5, dT_dt_6),
- axis=2) # dT_dt.shape:(100, 7, 6, 41, 81)
-
- # print('dT_dt.shape:{}'.format(dT_dt.shape))
- # # hycom_temp.shape:(100, 7, 7, 41, 81) time deep time lat lon
- # # print('xx.shape:{}'.format(xx.shape)) #xx.shape:(100, 7, 41, 81)
- xx = xx.reshape(-1, 1, 7, 41, 81)
- xx = xx.repeat(7, axis=1)
- # print('xx.shape:{}'.format(xx.shape))
-
- yy = yy.reshape(-1, 1, 7, 41, 81)
- yy = yy.repeat(7, axis=1)
-
- # # hycom_temp.shape:(100, 7, 7, 41, 81) time deep time lat lon
- list = []
- for i in range(40):
- xx_i = xx[:, :, :, i, :]
- xx_j = xx[:, :, :, i + 1, :]
- T_i = hycom_temp[:, :, :, i, :]
- T_j = hycom_temp[:, :, :, i + 1, :]
- dT_dx = (T_j - T_i) / (xx_j - xx_i)
- list.append(dT_dx)
- # print(dT_dx.shape)
- a = np.array(list)
- # print(a.shape) # (40, 100, 7, 7, 81)
-
- dT_dx = a.transpose(1, 2, 3, 0, 4)
- print(dT_dx.shape) # (100, 7, 7, 40, 81)
-
- list1 = []
- for j in range(80):
- yy_i = yy[:, :, :, :, j]
- yy_j = yy[:, :, :, :, j + 1]
- T_i = hycom_temp[:, :, :, :, j]
- T_j = hycom_temp[:, :, :, :, j + 1]
- dT_dy = (T_j - T_i) / (yy_j - yy_i)
- list1.append(dT_dy)
- # print(dT_dy.shape)
- b = np.array(list1)
- # print(b.shape) # (80, 100, 7, 7, 41)
-
- dT_dy = b.transpose(1, 2, 3, 4, 0)
- print(dT_dy.shape) # (100, 7, 7, 41, 80)
-
- dT_dt = dT_dt[:, :, :, :40, :80]
- dT_dx = dT_dx[:, :, :, :40, :80]
- dT_dy = dT_dy[:, :, :, :40, :80]
-
- # hycom_temp = hycom_temp[:,:,:,:40,:80]
- # slfh = data['slfh'][:, :, :40, :80] # (3281, 7, 41, 201)
- # sshf = data['sshf'][:, :, :40, :80] # (3281, 7, 41, 201)
- # ssr = data['ssr'][:, :, :40, :80] # (3281, 7, 41, 201)
- # str = data['str'][:, :, :40, :80] # (3281, 7, 41, 201)
- # mld = data['mld'][:, :, :40, :80] # (3281, 7, 41, 201)
- # analysis_temp = data['analysis_temp'][:1000,:,:,:40,:80] # (3281, 7, 7, 41, 201)
- # u = data['u'][:1000, :, :, :40, :80] # (3281, 7, 7, 41, 201)
- # v = data['v'][:1000, :, :, :40, :80] # (3281, 7, 7, 41, 201)
- # T_d = data['T_d'][:1000, :, :40, :80] # (3281, 7, 41, 201)
- # u_d = data['u_d'][:1000, :, :40, :80] # (3281, 7, 41, 201)
- # v_d = data['v_d'][:1000, :, :40, :80] # (3281, 7, 41, 201)
- # xx = data['xx'][:1000, :, :, :] # (3281, 7, 41, 201)
- # yy = data['yy'][:1000, :, :, :] # (3281, 7, 41, 201)
- # #
- #
- # dT_dt = dT_dt[:1000, :, :40, :80] # (3281, 7, 41, 201) # 过去7天预测未来一天 T7 - T6; T7 - T5; T7 - T4; T7 - T3; T7 - T2; T7 - T1
- #
- # dT_dx = dT_dx[:1000, :, :40, :80] # (3281, 7, 41, 201) # 过去7天预测未来一天 T7 - T6; T7 - T5; T7 - T4; T7 - T3; T7 - T2; T7 - T1
- # dT_dy = dT_dy[:1000, :, :40, :80] # (3281, 7, 41, 201)
-
- # analysis_temp = data['analysis_temp'][:1000, :, :, :40, :80] # (3281, 10, 7, 41, 201)
- analysis_temp = analysis_temp.transpose(0, 2, 1, 3, 4)
- # print(analysis_temp.shape)
- # print('hycom_temp.shape:{}'.format(hycom_temp.shape)) # hycom_temp.shape:(3281, 7, 7, 41, 81)
- #
- train_size = 1088 # 前60%
- valid_size = 1280 # 中间20% 作为验证 剩下的20%的作为测试
-
- Q_net = slfh + sshf + ssr + str
- # print(Q_net)
- hycom_temp = hycom_temp[:, :, :, :40, :80]
- hycom_temp = torch.Tensor(hycom_temp)
- hycom_temp = hycom_temp.permute(0, 2, 1, 3, 4)
- hycom_temp = hycom_temp.reshape(-1, 7, 7, 40, 80)
- hycom_temp = torch.Tensor(hycom_temp)
- hycom_temp_train = hycom_temp[0:train_size, :, :, :, :]
- hycom_temp_valid = hycom_temp[train_size:valid_size, :, :, :, :]
- hycom_temp_test = hycom_temp[valid_size:, :, :, :, :]
-
- Q_net = Q_net.reshape(-1, 1, 7, 40, 80)
- Q_net = torch.Tensor(Q_net)
- Q_net_train = Q_net[0:train_size, :, :, :, :]
- Q_net_valid = Q_net[train_size:valid_size, :, :, :, :]
- Q_net_test = Q_net[valid_size:, :, :, :, :]
- # print('Q_net.shape:{}'.format(Q_net.shape)) # hycom_temp.shape:(3281, 7, 7, 41, 81)
-
- mld = mld.reshape(-1, 1, 7, 40, 80)
- mld = torch.Tensor(mld)
- mld_train = mld[0:train_size, :, :, :, :]
-
- mld_valid = mld[train_size:valid_size, :, :, :, :]
- mld_test = mld[valid_size:, :, :, :, :]
-
- analysis_temp = analysis_temp[:, :, :, :40, :80]
- analysis_temp = torch.Tensor(analysis_temp)
- # analysis_temp = analysis_temp.permute(0,2,1,3,4)
- # print('analysis_temp.shape:{}'.format(analysis_temp.shape)) # hycom_temp.shape:(3281, 7, 7, 41, 81)
-
- analysis_temp = analysis_temp.reshape(-1, 7, 10, 40, 80)
- analysis_temp = torch.Tensor(analysis_temp)
- print('analysis_temp.shape:{}'.format(analysis_temp.shape)) # hycom_temp.shape:(3281, 7, 7, 41, 81)
-
- u = torch.Tensor(u)
- u = u.permute(0, 2, 1, 3, 4)
- u = u.reshape(-1, 7, 7, 40, 80)
- u = torch.Tensor(u)
- u_train = u[0:train_size, :, :, :, :]
- u_valid = u[train_size:valid_size, :, :, :, :]
- u_test = u[valid_size:, :, :, :, :]
-
- v = torch.Tensor(v)
- v = v.permute(0, 2, 1, 3, 4)
- v = v.reshape(-1, 7, 7, 40, 80)
- v = torch.Tensor(v)
- v_train = v[0:train_size, :, :, :, :]
- v_valid = v[train_size:valid_size, :, :, :, :]
- v_test = v[valid_size:, :, :, :, :]
-
- T_d = T_d.reshape(-1, 1, 7, 40, 80)
- T_d = torch.Tensor(T_d)
- T_d_train = T_d[0:train_size, :, :, :, :]
- T_d_valid = T_d[train_size:valid_size, :, :, :, :]
- T_d_test = T_d[valid_size:, :, :, :, :]
-
- u_d = u_d.reshape(-1, 1, 7, 40, 80)
- u_d = torch.Tensor(u_d)
- u_d_train = u_d[0:train_size, :, :, :, :]
- u_d_valid = u_d[train_size:valid_size, :, :, :, :]
- u_d_test = u_d[valid_size:, :, :, :, :]
-
- v_d = v_d.reshape(-1, 1, 7, 40, 80)
- v_d = torch.Tensor(v_d)
- v_d_train = v_d[0:train_size, :, :, :, :]
- v_d_valid = v_d[train_size:valid_size, :, :, :, :]
- v_d_test = v_d[valid_size:, :, :, :, :]
-
- # xx = xx.reshape(-1, 7, 7, 40, 80)
- # xx = torch.Tensor(xx)
- # xx_train = xx[0:train_size, :, :, :, :]
- # xx_valid = xx[train_size:valid_size, :, :, :, :]
- # xx_test = xx[valid_size:, :, :, :, :]
- #
- # yy = yy.reshape(-1, 7, 7, 40, 80)
- # yy = torch.Tensor(yy)
- #
- # yy_train = yy[0:train_size, :, :, :, :]
- # yy_valid = yy[train_size:valid_size, :, :, :, :]
- # yy_test = yy[valid_size:, :, :, :, :]
-
- dT_dt0 = torch.zeros(2000, 7, 1, 40, 80)
- dT_dt0 = np.array(dT_dt0)
- dT_dt = np.concatenate((dT_dt, dT_dt0), axis=2)
- # print('dT_dt.shape:{}'.format(dT_dt.shape))
- dT_dt = dT_dt[:, :, :, :40, :80]
- dT_dt = torch.Tensor(dT_dt)
- dT_dt_train = dT_dt[0:train_size, :, :, :, :]
- dT_dt_valid = dT_dt[train_size:valid_size, :, :, :, :]
- dT_dt_test = dT_dt[valid_size:, :, :, :, :]
-
- dT_dx = dT_dx[:, :, :, :40, :80]
- dT_dx = torch.Tensor(dT_dx)
- dT_dx_train = dT_dx[0:train_size, :, :, :, :]
- dT_dx_valid = dT_dx[train_size:valid_size, :, :, :, :]
- dT_dx_test = dT_dx[valid_size:, :, :, :, :]
-
- dT_dy = dT_dy[:, :, :, :40, :80]
- dT_dy = torch.Tensor(dT_dy)
- dT_dy_train = dT_dy[0:train_size, :, :, :, :]
- dT_dy_valid = dT_dy[train_size:valid_size, :, :, :, :]
- dT_dy_test = dT_dy[valid_size:, :, :, :, :]
-
- train_data = torch.cat((hycom_temp_train, Q_net_train, mld_train, u_train, v_train, T_d_train, v_d_train,
- dT_dt_train, dT_dx_train, dT_dy_train),
- dim=1) # train_data.shape:torch.Size([1952, 7, 32, 41, 81]) # 数据 第一维时间 第二维深度和变量 第三维7dat seq 4 5lat lon
-
- # # print('train_data.shape:{}'.format(train_data.shape))
-
- valid_data = torch.cat((hycom_temp_valid, Q_net_valid, mld_valid, u_valid, v_valid, T_d_valid, v_d_valid,
- dT_dt_valid, dT_dx_valid, dT_dy_valid),
- dim=1) # valid_data.shape:torch.Size([672, 7, 32, 41, 81])
- # # print('valid_data.shape:{}'.format(valid_data.shape)) # ([326, 3, 12, 15])
-
- # test_data = torch.cat((hycom_temp_test, Q_net_test, mld_test, u_test, v_test, T_d_test, v_d_test, dT_dt_test, dT_dx_test, dT_dy_test),dim=1) #
- # # print('test_data.shape:{}'.format(test_data.shape)) # ([326, 3, 12, 15])
-
- train_label = analysis_temp[7:train_size + 7, :, :,
- :] # train_label.shape:torch.Size([1952, 7, 7, 41, 81]) # 需要注意的是,不同与之前的实验,这次的label也经过了7day_for_Nday的过程,所以 只需要改变label nday_for_Nday的n,即可做到n天的预测
- train_label = train_label[:, :, 0, :, :]
- valid_label = analysis_temp[train_size + 7:valid_size + 7, :, :,
- :] # valid_label.shape:torch.Size([672, 7, 7, 41, 81])
- valid_label = valid_label[:, :, 0, :, :]
- # test_label = analysis_temp[valid_size + 7: 3646, :, :, :] # test_label.shape:torch.Size([650, 7, 7, 41, 81])
-
- # # print('train_label.shape:{}'.format(train_label.shape)) # test_label.shape:(63, 1, 6, 27)
-
- train_label = torch.Tensor(train_label)
- valid_label = torch.Tensor(valid_label)
- # test_label = torch.Tensor(test_label)
- # # print('valid_label.shape:{}'.format(valid_label.shape)) #train_label.shape:torch.Size([224, 1, 6, 27])
- # test_label11 = test_label
- valid_label11 = valid_label
- valid_label0 = valid_label[:, :, 0, :, :]
- import threading
-
-
- class MyDataset(Dataset):
- def __init__(self, data, label):
- self.data = torch.Tensor(data)
- self.label = torch.Tensor(label)
-
- def __len__(self):
- return len(self.label)
-
- def __getitem__(self, idx):
- return self.data[idx], self.label[idx]
-
-
- batch_size1 = 32
- batch_size2 = 32
- batch_size3 = 3000
- # import memory_profiler
- # @profile
- # def train(trainset, trainloader):
- # #code for training
- # print(1)
- # if __name__ == "__main__":
- trainset = MyDataset(train_data, train_label)
- trainloader = DataLoader(trainset, batch_size=batch_size1, shuffle=True, drop_last=False, pin_memory=True,
- num_workers=threading.active_count())
-
-
- def get_dataloader_generator(trainloader):
- while True:
- for data, label in trainloader:
- yield data, label
-
-
- validset = MyDataset(valid_data, valid_label)
- validloader = DataLoader(validset, batch_size=batch_size2, shuffle=True, drop_last=False, pin_memory=True,
- num_workers=threading.active_count())
-
-
- def get_dataloader_generator(validloader):
- while True:
- for data, label in validloader:
- yield data, label
- # testset = MyDataset(test_data, test_label)
- # testloader = DataLoader(testset, batch_size=batch_size3, shuffle=False, drop_last=False, pin_memory=True, num_workers=threading.active_count())
- # def get_dataloader_generator(testloader):
- # while True:
- # for data, label in testloader:
- # yield data, label
- # model = ConvNet(input_dim=1, input_dim1=7, hidden_dim=1, kernel_size1=(1, 3,), padding1=(0, 1),
- # kernel_size2=(1, 3), padding2=(0, 1), kernel_size3=(1, 3), padding3=(0, 1)).cuda()
- # criterion = torch.nn.MSELoss()
- # # 定义优化器
- # optimizer = torch.optim.Adam(model.parameters(), lr=1e-3)
-
- # epochs = 200
- # train_losses, valid_losses = [], []
- # # best_loss = 2
- # best_score = float('inf')
- # best_score2 = float('inf')
-
- # preds = np.zeros((192, 7, 40, 80))
- # # preds = np.expand_dims(preds, axis=1)#preds.reshape(100,1,12,15)
-
- # sores = []
-
- # def rmse(y_true, y_preds):
- # return np.sqrt(mean_squared_error(y_pred=y_preds, y_true=y_true))
-
- # class mse_origin(nn.Module):
- # def __init__(self):
- # super(mse_origin, self).__init__()
-
- # def forward(self, x, y):
- # loss = (x - y) ** 2
- # loss = torch.mean(loss)
- # return loss
-
- # class My_loss_mse(nn.Module):
- # def __init__(self):
- # super(My_loss_mse, self).__init__()
-
- # def forward(self, inputs, targets, activate='sigmoid', beta=.2, gamma=1):
- # loss = F.l1_loss(inputs, targets, reduction='none')
- # loss *= (torch.tanh(beta * torch.abs(inputs - targets))) ** gamma if activate == 'tanh' else \
- # (2 * torch.sigmoid(beta * torch.abs(inputs - targets)) - 1) ** gamma
-
- # loss = torch.mean(loss)
- # return loss
-
- # for epoch111 in range(200,201,1):
- # def setup_seed(seed):
- # torch.manual_seed(seed)
- # torch.cuda.manual_seed_all(seed)
- # np.random.seed(seed)
- # random.seed(seed)
- # torch.backends.cudnn.deterministic = True
-
- # # 设置随机数种子
- # setup_seed(iii)
-
- # model_weights1 = '/model/cnn_f(2)_pINN__epo{}_lay1_e{}_black_ahead_8_day_model_weights.pth'.format(epoch111,iii)
-
- # pred_val = np.zeros((192, 7, 40, 80))
- # for epoch in range(epochs):
- # print('Epoch: {}/{}'.format(epoch + 1, epochs))
- # # print(var_y)
- # # 模型训练
- # model.train()
- # losses = 0
- # for data, label in tqdm(trainloader):
- # data = data.cuda()
- # data1 = data[:, :, :, :, :] # 7个深度的 SST 和 XX 和 YY
- # # print('data.shape:{}'.format(data.shape)) #data.shape:torch.Size([32, 9, 3, 6, 27])
- # label = label.cuda()
- # certrion = nn.MSELoss()
- # optimizer.zero_grad()
-
- # T_m = data[:, 0:7, :, :, :].reshape(-1, 7, 7, 40, 80)
- # Q = data[:, 7:8, :, :, :].reshape(-1, 1, 7, 40, 80)
- # h_m = data[:, 8:9, :, :, :].reshape(-1, 1, 7, 40, 80)
- # u = data[:, 9:16, :, :, :].reshape(-1, 7, 7, 40, 80)
- # v = data[:, 16:23, :, :, :].reshape(-1, 7, 7, 40, 80)
- # T_d = data[:, 23:24, :, :, :].reshape(-1, 1, 7, 40, 80)
- # w_e = data[:, 24:25, :, :, :].reshape(-1, 1, 7, 40, 80)
- # dT_dt = data[:, 25:32, :, :, :].reshape(-1, 7, 7, 40, 80)
- # dT_dx = data[:, 32:39, :, :, :].reshape(-1, 7, 7, 40, 80)
- # dT_dy = data[:, 39:, :, :, :].reshape(-1, 7, 7, 40, 80)
- # # print('T_m.shape:{}'.format(T_m.shape))
- # # print('dT_dy.shape:{}'.format(dT_dy.shape))
-
- # # 表面数据 ----过去七天 注意第七个深度的dT_dt 为0
- # T_m_d1 = T_m[:, 0, :, :, :]
- # u_d1 = u[:, 0, :, :, :]
- # v_d1 = v[:, 0, :, :, :]
- # dT_dt_d1 = dT_dt[:, 0, :, :, :]
- # dT_dx_d1 = dT_dx[:, 0, :, :, :]
- # dT_dy_d1 = dT_dy[:, 0, :, :, :]
-
- # # # 表面数据 ----第一天 到7天
- # # list1 = [] # 存dT_1 ... dT_6 与计算的loss
- # # for j in range(7): # 7个深度
- # # for i in range(7):
- # # T_m_dj_i = T_m[:, j, i, :, :].reshape(-1, 1, 40, 80)
- # # u_dj_i = u[:, j, i, :, :].reshape(-1, 1, 40, 80)
- # # v_dj_i = v[:, j, i, :, :].reshape(-1, 1, 40, 80)
- # # # dT_dt_dj_i = dT_dt[:, j, i, :, :].reshape(-1, 1, 40, 80) # 过去七天也不可知dT_dt7
- # # dT_dx_dj_i = dT_dx[:, j, i, :, :].reshape(-1, 1, 40, 80)
- # # dT_dy_dj_i = dT_dy[:, j, i, :, :].reshape(-1, 1, 40, 80)
- # # Q_i = Q[:, :, i, :, :].reshape(-1, 1, 40, 80)
- # # h_m_i = h_m[:, :, i, :, :].reshape(-1, 1, 40, 80)
- # # T_d_i = T_d[:, :, i, :, :].reshape(-1, 1, 40, 80)
- # # w_e_i = w_e[:, :, i, :, :].reshape(-1, 1, 40, 80)
-
- # # data_j_i = u_dj_i * (dT_dx_dj_i)
- # # # print('data{}.shape:{}'.format(i, datai.shape)) # data0.shape:torch.Size([32, 1, 40, 80])
- # # out_j_i = model(data_j_i)
- # # # print('out{}.shape:{}'.format(i, outi.shape)) # data0.shape:torch.Size([32, 1, 40, 80])
-
- # # dT_dti = Q_i / (1025 * 4000 * h_m_i) + v_dj_i * (dT_dy_dj_i) + out_j_i + w_e_i * ((T_m_dj_i - T_d_i) / h_m_i)
- # # # print(dT_dti.shape)
- # # list1.append(dT_dti)
-
- # #深度0,天数1
- # T_m_d0_1 = T_m[:, 0, 0, :, :].reshape(-1, 1, 40, 80)
- # u_d0_1 = u[:, 0, 0, :, :].reshape(-1, 1, 40, 80)
- # v_d0_1 = v[:, 0, 0, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d0_1 = dT_dx[:, 0, 0, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d0_1 = dT_dy[:, 0, 0, :, :].reshape(-1, 1, 40, 80)
- # Q_1 = Q[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # h_m_1 = h_m[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # T_d_1 = T_d[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # w_e_1 = w_e[:, :, 0, :, :].reshape(-1, 1, 40, 80)
-
- # data_0_1 = u_d0_1 * (dT_dx_d0_1)
- # out_0_1 = model(data_0_1)
-
- # dT_dt_0_1 = Q_1 / (1025 * 4000 * h_m_1) + v_d0_1 * (dT_dy_d0_1) + out_0_1 + w_e_1 * ((T_m_d0_1 - T_d_1) / h_m_1)
-
- # #深度0,天数2
- # T_m_d0_2 = T_m[:, 0, 1, :, :].reshape(-1, 1, 40, 80)
- # u_d0_2 = u[:, 0, 1, :, :].reshape(-1, 1, 40, 80)
- # v_d0_2 = v[:, 0, 1, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d0_2 = dT_dx[:, 0, 1, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d0_2 = dT_dy[:, 0, 1, :, :].reshape(-1, 1, 40, 80)
- # Q_2 = Q[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # h_m_2 = h_m[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # T_d_2 = T_d[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # w_e_2 = w_e[:, :, 1, :, :].reshape(-1, 1, 40, 80)
-
- # data_0_2 = u_d0_2 * (dT_dx_d0_2)
- # out_0_2 = model(data_0_2)
-
- # dT_dt_0_2 = Q_2 / (1025 * 4000 * h_m_2) + v_d0_2 * (dT_dy_d0_2) + out_0_2 + w_e_2 * ((T_m_d0_2 - T_d_2) / h_m_2)
-
- # #深度0,天数3
- # T_m_d0_3 = T_m[:, 0, 2, :, :].reshape(-1, 1, 40, 80)
- # u_d0_3 = u[:, 0, 2, :, :].reshape(-1, 1, 40, 80)
- # v_d0_3 = v[:, 0, 2, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d0_3 = dT_dx[:, 0, 2, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d0_3 = dT_dy[:, 0, 2, :, :].reshape(-1, 1, 40, 80)
- # Q_3 = Q[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # h_m_3 = h_m[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # T_d_3 = T_d[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # w_e_3 = w_e[:, :, 2, :, :].reshape(-1, 1, 40, 80)
-
- # data_0_3 = u_d0_3 * (dT_dx_d0_3)
- # out_0_3 = model(data_0_3)
-
- # dT_dt_0_3 = Q_3 / (1025 * 4000 * h_m_3) + v_d0_3 * (dT_dy_d0_3) + out_0_3 + w_e_3 * ((T_m_d0_3 - T_d_3) / h_m_3)
-
- # #深度0,天数4
- # T_m_d0_4 = T_m[:, 0, 3, :, :].reshape(-1, 1, 40, 80)
- # u_d0_4 = u[:, 0, 3, :, :].reshape(-1, 1, 40, 80)
- # v_d0_4 = v[:, 0, 3, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d0_4 = dT_dx[:, 0, 3, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d0_4 = dT_dy[:, 0, 3, :, :].reshape(-1, 1, 40, 80)
- # Q_4 = Q[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # h_m_4 = h_m[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # T_d_4 = T_d[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # w_e_4 = w_e[:, :, 3, :, :].reshape(-1, 1, 40, 80)
-
- # data_0_4 = u_d0_4 * (dT_dx_d0_4)
- # out_0_4 = model(data_0_4)
-
- # dT_dt_0_4 = Q_4 / (1025 * 4000 * h_m_4) + v_d0_4 * (dT_dy_d0_4) + out_0_4 + w_e_4 * ((T_m_d0_4 - T_d_4) / h_m_4)
-
- # #深度0,天数5
- # T_m_d0_5 = T_m[:, 0, 4, :, :].reshape(-1, 1, 40, 80)
- # u_d0_5 = u[:, 0, 4, :, :].reshape(-1, 1, 40, 80)
- # v_d0_5 = v[:, 0, 4, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d0_5 = dT_dx[:, 0, 4, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d0_5 = dT_dy[:, 0, 4, :, :].reshape(-1, 1, 40, 80)
- # Q_5 = Q[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # h_m_5 = h_m[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # T_d_5 = T_d[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # w_e_5 = w_e[:, :, 4, :, :].reshape(-1, 1, 40, 80)
-
- # data_0_5 = u_d0_5 * (dT_dx_d0_5)
- # out_0_5 = model(data_0_5)
-
- # dT_dt_0_5 = Q_5 / (1025 * 4000 * h_m_5) + v_d0_5 * (dT_dy_d0_5) + out_0_5 + w_e_5 * ((T_m_d0_5 - T_d_5) / h_m_5)
-
- # #深度0,天数6
- # T_m_d0_6 = T_m[:, 0, 5, :, :].reshape(-1, 1, 40, 80)
- # u_d0_6 = u[:, 0, 5, :, :].reshape(-1, 1, 40, 80)
- # v_d0_6 = v[:, 0, 5, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d0_6 = dT_dx[:, 0, 5, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d0_6 = dT_dy[:, 0, 5, :, :].reshape(-1, 1, 40, 80)
- # Q_6 = Q[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # h_m_6 = h_m[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # T_d_6 = T_d[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # w_e_6 = w_e[:, :, 5, :, :].reshape(-1, 1, 40, 80)
-
- # data_0_6 = u_d0_6 * (dT_dx_d0_6)
- # out_0_6 = model(data_0_6)
-
- # dT_dt_0_6 = Q_6 / (1025 * 4000 * h_m_6) + v_d0_6 * (dT_dy_d0_6) + out_0_6 + w_e_6 * ((T_m_d0_6 - T_d_6) / h_m_6)
-
- # #深度0,天数7
- # T_m_d0_7 = T_m[:, 0, 6, :, :].reshape(-1, 1, 40, 80)
- # u_d0_7 = u[:, 0, 6, :, :].reshape(-1, 1, 40, 80)
- # v_d0_7 = v[:, 0, 6, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d0_7 = dT_dx[:, 0, 6, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d0_7 = dT_dy[:, 0, 6, :, :].reshape(-1, 1, 40, 80)
- # Q_7 = Q[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # h_m_7 = h_m[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # T_d_7 = T_d[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # w_e_7 = w_e[:, :, 6, :, :].reshape(-1, 1, 40, 80)
-
- # data_0_7 = u_d0_7 * (dT_dx_d0_7)
- # out_0_7 = model(data_0_7)
-
- # dT_dt_0_7 = Q_7 / (1025 * 4000 * h_m_7) + v_d0_7 * (dT_dy_d0_7) + out_0_7 + w_e_7 * ((T_m_d0_7 - T_d_7) / h_m_7)
-
- # #深度1,天数1
- # T_m_d1_1 = T_m[:, 1, 0, :, :].reshape(-1, 1, 40, 80)
- # u_d1_1 = u[:, 1, 0, :, :].reshape(-1, 1, 40, 80)
- # v_d1_1 = v[:, 1, 0, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d1_1 = dT_dx[:, 1, 0, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d1_1 = dT_dy[:, 1, 0, :, :].reshape(-1, 1, 40, 80)
- # Q_1 = Q[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # h_m_1 = h_m[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # T_d_1 = T_d[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # w_e_1 = w_e[:, :, 0, :, :].reshape(-1, 1, 40, 80)
-
- # data_1_1 = u_d1_1 * (dT_dx_d1_1)
- # out_1_1 = model(data_1_1)
-
- # dT_dt_1_1 = Q_1 / (1025 * 4000 * h_m_1) + v_d1_1 * (dT_dy_d1_1) + out_1_1 + w_e_1 * ((T_m_d1_1 - T_d_1) / h_m_1)
-
- # #深度1,天数2
- # T_m_d1_2 = T_m[:, 1, 1, :, :].reshape(-1, 1, 40, 80)
- # u_d1_2 = u[:, 1, 1, :, :].reshape(-1, 1, 40, 80)
- # v_d1_2 = v[:, 1, 1, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d1_2 = dT_dx[:, 1, 1, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d1_2 = dT_dy[:, 1, 1, :, :].reshape(-1, 1, 40, 80)
- # Q_2 = Q[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # h_m_2 = h_m[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # T_d_2 = T_d[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # w_e_2 = w_e[:, :, 1, :, :].reshape(-1, 1, 40, 80)
-
- # data_1_2 = u_d1_2 * (dT_dx_d1_2)
- # out_1_2 = model(data_1_2)
-
- # dT_dt_1_2 = Q_2 / (1025 * 4000 * h_m_2) + v_d1_2 * (dT_dy_d1_2) + out_1_2 + w_e_2 * ((T_m_d1_2 - T_d_2) / h_m_2)
-
- # #深度1,天数3
- # T_m_d1_3 = T_m[:, 1, 2, :, :].reshape(-1, 1, 40, 80)
- # u_d1_3 = u[:, 1, 2, :, :].reshape(-1, 1, 40, 80)
- # v_d1_3 = v[:, 1, 2, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d1_3 = dT_dx[:, 1, 2, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d1_3 = dT_dy[:, 1, 2, :, :].reshape(-1, 1, 40, 80)
- # Q_3 = Q[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # h_m_3 = h_m[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # T_d_3 = T_d[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # w_e_3 = w_e[:, :, 2, :, :].reshape(-1, 1, 40, 80)
-
- # data_1_3 = u_d1_3 * (dT_dx_d1_3)
- # out_1_3 = model(data_1_3)
-
- # dT_dt_1_3 = Q_3 / (1025 * 4000 * h_m_3) + v_d1_3 * (dT_dy_d1_3) + out_1_3 + w_e_3 * ((T_m_d1_3 - T_d_3) / h_m_3)
-
- # #深度1,天数4
- # T_m_d1_4 = T_m[:, 1, 3, :, :].reshape(-1, 1, 40, 80)
- # u_d1_4 = u[:, 1, 3, :, :].reshape(-1, 1, 40, 80)
- # v_d1_4 = v[:, 1, 3, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d1_4 = dT_dx[:, 1, 3, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d1_4 = dT_dy[:, 1, 3, :, :].reshape(-1, 1, 40, 80)
- # Q_4 = Q[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # h_m_4 = h_m[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # T_d_4 = T_d[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # w_e_4 = w_e[:, :, 3, :, :].reshape(-1, 1, 40, 80)
-
- # data_1_4 = u_d1_4 * (dT_dx_d1_4)
- # out_1_4 = model(data_1_4)
-
- # dT_dt_1_4 = Q_4 / (1025 * 4000 * h_m_4) + v_d1_4 * (dT_dy_d1_4) + out_1_4 + w_e_4 * ((T_m_d1_4 - T_d_4) / h_m_4)
-
- # #深度1,天数5
- # T_m_d1_5 = T_m[:, 1, 4, :, :].reshape(-1, 1, 40, 80)
- # u_d1_5 = u[:, 1, 4, :, :].reshape(-1, 1, 40, 80)
- # v_d1_5 = v[:, 1, 4, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d1_5 = dT_dx[:, 1, 4, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d1_5 = dT_dy[:, 1, 4, :, :].reshape(-1, 1, 40, 80)
- # Q_5 = Q[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # h_m_5 = h_m[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # T_d_5 = T_d[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # w_e_5 = w_e[:, :, 4, :, :].reshape(-1, 1, 40, 80)
-
- # data_1_5 = u_d1_5 * (dT_dx_d1_5)
- # out_1_5 = model(data_1_5)
-
- # dT_dt_1_5 = Q_5 / (1025 * 4000 * h_m_5) + v_d1_5 * (dT_dy_d1_5) + out_1_5 + w_e_5 * ((T_m_d1_5 - T_d_5) / h_m_5)
-
- # #深度1,天数6
- # T_m_d1_6 = T_m[:, 1, 5, :, :].reshape(-1, 1, 40, 80)
- # u_d1_6 = u[:, 1, 5, :, :].reshape(-1, 1, 40, 80)
- # v_d1_6 = v[:, 1, 5, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d1_6 = dT_dx[:, 1, 5, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d1_6 = dT_dy[:, 1, 5, :, :].reshape(-1, 1, 40, 80)
- # Q_6 = Q[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # h_m_6 = h_m[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # T_d_6 = T_d[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # w_e_6 = w_e[:, :, 5, :, :].reshape(-1, 1, 40, 80)
-
- # data_1_6 = u_d1_6 * (dT_dx_d1_6)
- # out_1_6 = model(data_1_6)
-
- # dT_dt_1_6 = Q_6 / (1025 * 4000 * h_m_6) + v_d1_6 * (dT_dy_d1_6) + out_1_6 + w_e_6 * ((T_m_d1_6 - T_d_6) / h_m_6)
-
- # #深度1,天数7
- # T_m_d1_7 = T_m[:, 1, 6, :, :].reshape(-1, 1, 40, 80)
- # u_d1_7 = u[:, 1, 6, :, :].reshape(-1, 1, 40, 80)
- # v_d1_7 = v[:, 1, 6, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d1_7 = dT_dx[:, 1, 6, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d1_7 = dT_dy[:, 1, 6, :, :].reshape(-1, 1, 40, 80)
- # Q_7 = Q[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # h_m_7 = h_m[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # T_d_7 = T_d[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # w_e_7 = w_e[:, :, 6, :, :].reshape(-1, 1, 40, 80)
-
- # data_1_7 = u_d1_7 * (dT_dx_d1_7)
- # out_1_7 = model(data_1_7)
-
- # dT_dt_1_7 = Q_7 / (1025 * 4000 * h_m_7) + v_d1_7 * (dT_dy_d1_7) + out_1_7 + w_e_7 * ((T_m_d1_7 - T_d_7) / h_m_7)
-
- # #深度2,天数1
- # T_m_d2_1 = T_m[:, 2, 0, :, :].reshape(-1, 1, 40, 80)
- # u_d2_1 = u[:, 2, 0, :, :].reshape(-1, 1, 40, 80)
- # v_d2_1 = v[:, 2, 0, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d2_1 = dT_dx[:, 2, 0, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d2_1 = dT_dy[:, 2, 0, :, :].reshape(-1, 1, 40, 80)
- # Q_1 = Q[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # h_m_1 = h_m[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # T_d_1 = T_d[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # w_e_1 = w_e[:, :, 0, :, :].reshape(-1, 1, 40, 80)
-
- # data_2_1 = u_d2_1 * (dT_dx_d2_1)
- # out_2_1 = model(data_2_1)
-
- # dT_dt_2_1 = Q_1 / (1025 * 4000 * h_m_1) + v_d2_1 * (dT_dy_d2_1) + out_2_1 + w_e_1 * ((T_m_d2_1 - T_d_1) / h_m_1)
-
- # #深度2,天数2
- # T_m_d2_2 = T_m[:, 2, 1, :, :].reshape(-1, 1, 40, 80)
- # u_d2_2 = u[:, 2, 1, :, :].reshape(-1, 1, 40, 80)
- # v_d2_2 = v[:, 2, 1, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d2_2 = dT_dx[:, 2, 1, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d2_2 = dT_dy[:, 2, 1, :, :].reshape(-1, 1, 40, 80)
- # Q_2 = Q[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # h_m_2 = h_m[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # T_d_2 = T_d[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # w_e_2 = w_e[:, :, 1, :, :].reshape(-1, 1, 40, 80)
-
- # data_2_2 = u_d2_2 * (dT_dx_d2_2)
- # out_2_2 = model(data_2_2)
-
- # dT_dt_2_2 = Q_2 / (1025 * 4000 * h_m_2) + v_d2_2 * (dT_dy_d2_2) + out_2_2 + w_e_2 * ((T_m_d2_2 - T_d_2) / h_m_2)
-
- # #深度2,天数3
- # T_m_d2_3 = T_m[:, 2, 2, :, :].reshape(-1, 1, 40, 80)
- # u_d2_3 = u[:, 2, 2, :, :].reshape(-1, 1, 40, 80)
- # v_d2_3 = v[:, 2, 2, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d2_3 = dT_dx[:, 2, 2, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d2_3 = dT_dy[:, 2, 2, :, :].reshape(-1, 1, 40, 80)
- # Q_3 = Q[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # h_m_3 = h_m[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # T_d_3 = T_d[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # w_e_3 = w_e[:, :, 2, :, :].reshape(-1, 1, 40, 80)
-
- # data_2_3 = u_d2_3 * (dT_dx_d2_3)
- # out_2_3 = model(data_2_3)
-
- # dT_dt_2_3 = Q_3 / (1025 * 4000 * h_m_3) + v_d2_3 * (dT_dy_d2_3) + out_2_3 + w_e_3 * ((T_m_d2_3 - T_d_3) / h_m_3)
-
- # #深度2,天数4
- # T_m_d2_4 = T_m[:, 2, 3, :, :].reshape(-1, 1, 40, 80)
- # u_d2_4 = u[:, 2, 3, :, :].reshape(-1, 1, 40, 80)
- # v_d2_4 = v[:, 2, 3, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d2_4 = dT_dx[:, 2, 3, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d2_4 = dT_dy[:, 2, 3, :, :].reshape(-1, 1, 40, 80)
- # Q_4 = Q[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # h_m_4 = h_m[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # T_d_4 = T_d[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # w_e_4 = w_e[:, :, 3, :, :].reshape(-1, 1, 40, 80)
-
- # data_2_4 = u_d2_4 * (dT_dx_d2_4)
- # out_2_4 = model(data_2_4)
-
- # dT_dt_2_4 = Q_4 / (1025 * 4000 * h_m_4) + v_d2_4 * (dT_dy_d2_4) + out_2_4 + w_e_4 * ((T_m_d2_4 - T_d_4) / h_m_4)
-
- # #深度2,天数5
- # T_m_d2_5 = T_m[:, 2, 4, :, :].reshape(-1, 1, 40, 80)
- # u_d2_5 = u[:, 2, 4, :, :].reshape(-1, 1, 40, 80)
- # v_d2_5 = v[:, 2, 4, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d2_5 = dT_dx[:, 2, 4, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d2_5 = dT_dy[:, 2, 4, :, :].reshape(-1, 1, 40, 80)
- # Q_5 = Q[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # h_m_5 = h_m[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # T_d_5 = T_d[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # w_e_5 = w_e[:, :, 4, :, :].reshape(-1, 1, 40, 80)
-
- # data_2_5 = u_d2_5 * (dT_dx_d2_5)
- # out_2_5 = model(data_2_5)
-
- # dT_dt_2_5 = Q_5 / (1025 * 4000 * h_m_5) + v_d2_5 * (dT_dy_d2_5) + out_2_5 + w_e_5 * ((T_m_d2_5 - T_d_5) / h_m_5)
-
- # #深度2,天数6
- # T_m_d2_6 = T_m[:, 2, 5, :, :].reshape(-1, 1, 40, 80)
- # u_d2_6 = u[:, 2, 5, :, :].reshape(-1, 1, 40, 80)
- # v_d2_6 = v[:, 2, 5, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d2_6 = dT_dx[:, 2, 5, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d2_6 = dT_dy[:, 2, 5, :, :].reshape(-1, 1, 40, 80)
- # Q_6 = Q[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # h_m_6 = h_m[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # T_d_6 = T_d[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # w_e_6 = w_e[:, :, 5, :, :].reshape(-1, 1, 40, 80)
-
- # data_2_6 = u_d2_6 * (dT_dx_d2_6)
- # out_2_6 = model(data_2_6)
-
- # dT_dt_2_6 = Q_6 / (1025 * 4000 * h_m_6) + v_d2_6 * (dT_dy_d2_6) + out_2_6 + w_e_6 * ((T_m_d2_6 - T_d_6) / h_m_6)
-
- # #深度2,天数7
- # T_m_d2_7 = T_m[:, 2, 6, :, :].reshape(-1, 1, 40, 80)
- # u_d2_7 = u[:, 2, 6, :, :].reshape(-1, 1, 40, 80)
- # v_d2_7 = v[:, 2, 6, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d2_7 = dT_dx[:, 2, 6, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d2_7 = dT_dy[:, 2, 6, :, :].reshape(-1, 1, 40, 80)
- # Q_7 = Q[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # h_m_7 = h_m[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # T_d_7 = T_d[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # w_e_7 = w_e[:, :, 6, :, :].reshape(-1, 1, 40, 80)
-
- # data_2_7 = u_d2_7 * (dT_dx_d2_7)
- # out_2_7 = model(data_2_7)
-
- # dT_dt_2_7 = Q_7 / (1025 * 4000 * h_m_7) + v_d2_7 * (dT_dy_d2_7) + out_2_7 + w_e_7 * ((T_m_d2_7 - T_d_7) / h_m_7)
-
- # #深度3,天数1
- # T_m_d3_1 = T_m[:, 3, 0, :, :].reshape(-1, 1, 40, 80)
- # u_d3_1 = u[:, 3, 0, :, :].reshape(-1, 1, 40, 80)
- # v_d3_1 = v[:, 3, 0, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d3_1 = dT_dx[:, 3, 0, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d3_1 = dT_dy[:, 3, 0, :, :].reshape(-1, 1, 40, 80)
- # Q_1 = Q[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # h_m_1 = h_m[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # T_d_1 = T_d[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # w_e_1 = w_e[:, :, 0, :, :].reshape(-1, 1, 40, 80)
-
- # data_3_1 = u_d3_1 * (dT_dx_d3_1)
- # out_3_1 = model(data_3_1)
-
- # dT_dt_3_1 = Q_1 / (1025 * 4000 * h_m_1) + v_d3_1 * (dT_dy_d3_1) + out_3_1 + w_e_1 * ((T_m_d3_1 - T_d_1) / h_m_1)
-
- # #深度3,天数2
- # T_m_d3_2 = T_m[:, 3, 1, :, :].reshape(-1, 1, 40, 80)
- # u_d3_2 = u[:, 3, 1, :, :].reshape(-1, 1, 40, 80)
- # v_d3_2 = v[:, 3, 1, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d3_2 = dT_dx[:, 3, 1, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d3_2 = dT_dy[:, 3, 1, :, :].reshape(-1, 1, 40, 80)
- # Q_2 = Q[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # h_m_2 = h_m[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # T_d_2 = T_d[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # w_e_2 = w_e[:, :, 1, :, :].reshape(-1, 1, 40, 80)
-
- # data_3_2 = u_d3_2 * (dT_dx_d3_2)
- # out_3_2 = model(data_3_2)
-
- # dT_dt_3_2 = Q_2 / (1025 * 4000 * h_m_2) + v_d3_2 * (dT_dy_d3_2) + out_3_2 + w_e_2 * ((T_m_d3_2 - T_d_2) / h_m_2)
-
- # #深度3,天数3
- # T_m_d3_3 = T_m[:, 3, 2, :, :].reshape(-1, 1, 40, 80)
- # u_d3_3 = u[:, 3, 2, :, :].reshape(-1, 1, 40, 80)
- # v_d3_3 = v[:, 3, 2, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d3_3 = dT_dx[:, 3, 2, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d3_3 = dT_dy[:, 3, 2, :, :].reshape(-1, 1, 40, 80)
- # Q_3 = Q[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # h_m_3 = h_m[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # T_d_3 = T_d[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # w_e_3 = w_e[:, :, 2, :, :].reshape(-1, 1, 40, 80)
-
- # data_3_3 = u_d3_3 * (dT_dx_d3_3)
- # out_3_3 = model(data_3_3)
-
- # dT_dt_3_3 = Q_3 / (1025 * 4000 * h_m_3) + v_d3_3 * (dT_dy_d3_3) + out_3_3 + w_e_3 * ((T_m_d3_3 - T_d_3) / h_m_3)
-
- # #深度3,天数4
- # T_m_d3_4 = T_m[:, 3, 3, :, :].reshape(-1, 1, 40, 80)
- # u_d3_4 = u[:, 3, 3, :, :].reshape(-1, 1, 40, 80)
- # v_d3_4 = v[:, 3, 3, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d3_4 = dT_dx[:, 3, 3, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d3_4 = dT_dy[:, 3, 3, :, :].reshape(-1, 1, 40, 80)
- # Q_4 = Q[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # h_m_4 = h_m[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # T_d_4 = T_d[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # w_e_4 = w_e[:, :, 3, :, :].reshape(-1, 1, 40, 80)
-
- # data_3_4 = u_d3_4 * (dT_dx_d3_4)
- # out_3_4 = model(data_3_4)
-
- # dT_dt_3_4 = Q_4 / (1025 * 4000 * h_m_4) + v_d3_4 * (dT_dy_d3_4) + out_3_4 + w_e_4 * ((T_m_d3_4 - T_d_4) / h_m_4)
-
- # #深度3,天数5
- # T_m_d3_5 = T_m[:, 3, 4, :, :].reshape(-1, 1, 40, 80)
- # u_d3_5 = u[:, 3, 4, :, :].reshape(-1, 1, 40, 80)
- # v_d3_5 = v[:, 3, 4, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d3_5 = dT_dx[:, 3, 4, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d3_5 = dT_dy[:, 3, 4, :, :].reshape(-1, 1, 40, 80)
- # Q_5 = Q[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # h_m_5 = h_m[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # T_d_5 = T_d[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # w_e_5 = w_e[:, :, 4, :, :].reshape(-1, 1, 40, 80)
-
- # data_3_5 = u_d3_5 * (dT_dx_d3_5)
- # out_3_5 = model(data_3_5)
-
- # dT_dt_3_5 = Q_5 / (1025 * 4000 * h_m_5) + v_d3_5 * (dT_dy_d3_5) + out_3_5 + w_e_5 * ((T_m_d3_5 - T_d_5) / h_m_5)
-
- # #深度3,天数6
- # T_m_d3_6 = T_m[:, 3, 5, :, :].reshape(-1, 1, 40, 80)
- # u_d3_6 = u[:, 3, 5, :, :].reshape(-1, 1, 40, 80)
- # v_d3_6 = v[:, 3, 5, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d3_6 = dT_dx[:, 3, 5, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d3_6 = dT_dy[:, 3, 5, :, :].reshape(-1, 1, 40, 80)
- # Q_6 = Q[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # h_m_6 = h_m[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # T_d_6 = T_d[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # w_e_6 = w_e[:, :, 5, :, :].reshape(-1, 1, 40, 80)
-
- # data_3_6 = u_d3_6 * (dT_dx_d3_6)
- # out_3_6 = model(data_3_6)
-
- # dT_dt_3_6 = Q_6 / (1025 * 4000 * h_m_6) + v_d3_6 * (dT_dy_d3_6) + out_3_6 + w_e_6 * ((T_m_d3_6 - T_d_6) / h_m_6)
-
- # #深度3,天数7
- # T_m_d3_7 = T_m[:, 3, 6, :, :].reshape(-1, 1, 40, 80)
- # u_d3_7 = u[:, 3, 6, :, :].reshape(-1, 1, 40, 80)
- # v_d3_7 = v[:, 3, 6, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d3_7 = dT_dx[:, 3, 6, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d3_7 = dT_dy[:, 3, 6, :, :].reshape(-1, 1, 40, 80)
- # Q_7 = Q[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # h_m_7 = h_m[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # T_d_7 = T_d[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # w_e_7 = w_e[:, :, 6, :, :].reshape(-1, 1, 40, 80)
-
- # data_3_7 = u_d3_7 * (dT_dx_d3_7)
- # out_3_7 = model(data_3_7)
-
- # dT_dt_3_7 = Q_7 / (1025 * 4000 * h_m_7) + v_d3_7 * (dT_dy_d3_7) + out_3_7 + w_e_7 * ((T_m_d3_7 - T_d_7) / h_m_7)
-
- # #深度4,天数1
- # T_m_d4_1 = T_m[:, 4, 0, :, :].reshape(-1, 1, 40, 80)
- # u_d4_1 = u[:, 4, 0, :, :].reshape(-1, 1, 40, 80)
- # v_d4_1 = v[:, 4, 0, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d4_1 = dT_dx[:, 4, 0, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d4_1 = dT_dy[:, 4, 0, :, :].reshape(-1, 1, 40, 80)
- # Q_1 = Q[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # h_m_1 = h_m[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # T_d_1 = T_d[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # w_e_1 = w_e[:, :, 0, :, :].reshape(-1, 1, 40, 80)
-
- # data_4_1 = u_d4_1 * (dT_dx_d4_1)
- # out_4_1 = model(data_4_1)
-
- # dT_dt_4_1 = Q_1 / (1025 * 4000 * h_m_1) + v_d4_1 * (dT_dy_d4_1) + out_4_1 + w_e_1 * ((T_m_d4_1 - T_d_1) / h_m_1)
-
- # #深度4,天数2
- # T_m_d4_2 = T_m[:, 4, 1, :, :].reshape(-1, 1, 40, 80)
- # u_d4_2 = u[:, 4, 1, :, :].reshape(-1, 1, 40, 80)
- # v_d4_2 = v[:, 4, 1, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d4_2 = dT_dx[:, 4, 1, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d4_2 = dT_dy[:, 4, 1, :, :].reshape(-1, 1, 40, 80)
- # Q_2 = Q[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # h_m_2 = h_m[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # T_d_2 = T_d[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # w_e_2 = w_e[:, :, 1, :, :].reshape(-1, 1, 40, 80)
-
- # data_4_2 = u_d4_2 * (dT_dx_d4_2)
- # out_4_2 = model(data_4_2)
-
- # dT_dt_4_2 = Q_2 / (1025 * 4000 * h_m_2) + v_d4_2 * (dT_dy_d4_2) + out_4_2 + w_e_2 * ((T_m_d4_2 - T_d_2) / h_m_2)
-
- # #深度4,天数3
- # T_m_d4_3 = T_m[:, 4, 2, :, :].reshape(-1, 1, 40, 80)
- # u_d4_3 = u[:, 4, 2, :, :].reshape(-1, 1, 40, 80)
- # v_d4_3 = v[:, 4, 2, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d4_3 = dT_dx[:, 4, 2, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d4_3 = dT_dy[:, 4, 2, :, :].reshape(-1, 1, 40, 80)
- # Q_3 = Q[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # h_m_3 = h_m[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # T_d_3 = T_d[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # w_e_3 = w_e[:, :, 2, :, :].reshape(-1, 1, 40, 80)
-
- # data_4_3 = u_d4_3 * (dT_dx_d4_3)
- # out_4_3 = model(data_4_3)
-
- # dT_dt_4_3 = Q_3 / (1025 * 4000 * h_m_3) + v_d4_3 * (dT_dy_d4_3) + out_4_3 + w_e_3 * ((T_m_d4_3 - T_d_3) / h_m_3)
-
- # #深度4,天数4
- # T_m_d4_4 = T_m[:, 4, 3, :, :].reshape(-1, 1, 40, 80)
- # u_d4_4 = u[:, 4, 3, :, :].reshape(-1, 1, 40, 80)
- # v_d4_4 = v[:, 4, 3, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d4_4 = dT_dx[:, 4, 3, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d4_4 = dT_dy[:, 4, 3, :, :].reshape(-1, 1, 40, 80)
- # Q_4 = Q[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # h_m_4 = h_m[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # T_d_4 = T_d[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # w_e_4 = w_e[:, :, 3, :, :].reshape(-1, 1, 40, 80)
-
- # data_4_4 = u_d4_4 * (dT_dx_d4_4)
- # out_4_4 = model(data_4_4)
-
- # dT_dt_4_4 = Q_4 / (1025 * 4000 * h_m_4) + v_d4_4 * (dT_dy_d4_4) + out_4_4 + w_e_4 * ((T_m_d4_4 - T_d_4) / h_m_4)
-
- # #深度4,天数5
- # T_m_d4_5 = T_m[:, 4, 4, :, :].reshape(-1, 1, 40, 80)
- # u_d4_5 = u[:, 4, 4, :, :].reshape(-1, 1, 40, 80)
- # v_d4_5 = v[:, 4, 4, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d4_5 = dT_dx[:, 4, 4, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d4_5 = dT_dy[:, 4, 4, :, :].reshape(-1, 1, 40, 80)
- # Q_5 = Q[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # h_m_5 = h_m[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # T_d_5 = T_d[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # w_e_5 = w_e[:, :, 4, :, :].reshape(-1, 1, 40, 80)
-
- # data_4_5 = u_d4_5 * (dT_dx_d4_5)
- # out_4_5 = model(data_4_5)
-
- # dT_dt_4_5 = Q_5 / (1025 * 4000 * h_m_5) + v_d4_5 * (dT_dy_d4_5) + out_4_5 + w_e_5 * ((T_m_d4_5 - T_d_5) / h_m_5)
-
- # #深度4,天数6
- # T_m_d4_6 = T_m[:, 4, 5, :, :].reshape(-1, 1, 40, 80)
- # u_d4_6 = u[:, 4, 5, :, :].reshape(-1, 1, 40, 80)
- # v_d4_6 = v[:, 4, 5, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d4_6 = dT_dx[:, 4, 5, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d4_6 = dT_dy[:, 4, 5, :, :].reshape(-1, 1, 40, 80)
- # Q_6 = Q[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # h_m_6 = h_m[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # T_d_6 = T_d[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # w_e_6 = w_e[:, :, 5, :, :].reshape(-1, 1, 40, 80)
-
- # data_4_6 = u_d4_6 * (dT_dx_d4_6)
- # out_4_6 = model(data_4_6)
-
- # dT_dt_4_6 = Q_6 / (1025 * 4000 * h_m_6) + v_d4_6 * (dT_dy_d4_6) + out_4_6 + w_e_6 * ((T_m_d4_6 - T_d_6) / h_m_6)
-
- # #深度4,天数7
- # T_m_d4_7 = T_m[:, 4, 6, :, :].reshape(-1, 1, 40, 80)
- # u_d4_7 = u[:, 4, 6, :, :].reshape(-1, 1, 40, 80)
- # v_d4_7 = v[:, 4, 6, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d4_7 = dT_dx[:, 4, 6, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d4_7 = dT_dy[:, 4, 6, :, :].reshape(-1, 1, 40, 80)
- # Q_7 = Q[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # h_m_7 = h_m[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # T_d_7 = T_d[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # w_e_7 = w_e[:, :, 6, :, :].reshape(-1, 1, 40, 80)
-
- # data_4_7 = u_d4_7 * (dT_dx_d4_7)
- # out_4_7 = model(data_4_7)
-
- # dT_dt_4_7 = Q_7 / (1025 * 4000 * h_m_7) + v_d4_7 * (dT_dy_d4_7) + out_4_7 + w_e_7 * ((T_m_d4_7 - T_d_7) / h_m_7)
-
- # #深度5,天数1
- # T_m_d5_1 = T_m[:, 5, 0, :, :].reshape(-1, 1, 40, 80)
- # u_d5_1 = u[:, 5, 0, :, :].reshape(-1, 1, 40, 80)
- # v_d5_1 = v[:, 5, 0, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d5_1 = dT_dx[:, 5, 0, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d5_1 = dT_dy[:, 5, 0, :, :].reshape(-1, 1, 40, 80)
- # Q_1 = Q[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # h_m_1 = h_m[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # T_d_1 = T_d[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # w_e_1 = w_e[:, :, 0, :, :].reshape(-1, 1, 40, 80)
-
- # data_5_1 = u_d5_1 * (dT_dx_d5_1)
- # out_5_1 = model(data_5_1)
-
- # dT_dt_5_1 = Q_1 / (1025 * 4000 * h_m_1) + v_d5_1 * (dT_dy_d5_1) + out_5_1 + w_e_1 * ((T_m_d5_1 - T_d_1) / h_m_1)
-
- # #深度5,天数2
- # T_m_d5_2 = T_m[:, 5, 1, :, :].reshape(-1, 1, 40, 80)
- # u_d5_2 = u[:, 5, 1, :, :].reshape(-1, 1, 40, 80)
- # v_d5_2 = v[:, 5, 1, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d5_2 = dT_dx[:, 5, 1, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d5_2 = dT_dy[:, 5, 1, :, :].reshape(-1, 1, 40, 80)
- # Q_2 = Q[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # h_m_2 = h_m[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # T_d_2 = T_d[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # w_e_2 = w_e[:, :, 1, :, :].reshape(-1, 1, 40, 80)
-
- # data_5_2 = u_d5_2 * (dT_dx_d5_2)
- # out_5_2 = model(data_5_2)
-
- # dT_dt_5_2 = Q_2 / (1025 * 4000 * h_m_2) + v_d5_2 * (dT_dy_d5_2) + out_5_2 + w_e_2 * ((T_m_d5_2 - T_d_2) / h_m_2)
-
- # #深度5,天数3
- # T_m_d5_3 = T_m[:, 5, 2, :, :].reshape(-1, 1, 40, 80)
- # u_d5_3 = u[:, 5, 2, :, :].reshape(-1, 1, 40, 80)
- # v_d5_3 = v[:, 5, 2, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d5_3 = dT_dx[:, 5, 2, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d5_3 = dT_dy[:, 5, 2, :, :].reshape(-1, 1, 40, 80)
- # Q_3 = Q[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # h_m_3 = h_m[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # T_d_3 = T_d[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # w_e_3 = w_e[:, :, 2, :, :].reshape(-1, 1, 40, 80)
-
- # data_5_3 = u_d5_3 * (dT_dx_d5_3)
- # out_5_3 = model(data_5_3)
-
- # dT_dt_5_3 = Q_3 / (1025 * 4000 * h_m_3) + v_d5_3 * (dT_dy_d5_3) + out_5_3 + w_e_3 * ((T_m_d5_3 - T_d_3) / h_m_3)
-
- # #深度5,天数4
- # T_m_d5_4 = T_m[:, 5, 3, :, :].reshape(-1, 1, 40, 80)
- # u_d5_4 = u[:, 5, 3, :, :].reshape(-1, 1, 40, 80)
- # v_d5_4 = v[:, 5, 3, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d5_4 = dT_dx[:, 5, 3, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d5_4 = dT_dy[:, 5, 3, :, :].reshape(-1, 1, 40, 80)
- # Q_4 = Q[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # h_m_4 = h_m[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # T_d_4 = T_d[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # w_e_4 = w_e[:, :, 3, :, :].reshape(-1, 1, 40, 80)
-
- # data_5_4 = u_d5_4 * (dT_dx_d5_4)
- # out_5_4 = model(data_5_4)
-
- # dT_dt_5_4 = Q_4 / (1025 * 4000 * h_m_4) + v_d5_4 * (dT_dy_d5_4) + out_5_4 + w_e_4 * ((T_m_d5_4 - T_d_4) / h_m_4)
-
- # #深度5,天数5
- # T_m_d5_5 = T_m[:, 5, 4, :, :].reshape(-1, 1, 40, 80)
- # u_d5_5 = u[:, 5, 4, :, :].reshape(-1, 1, 40, 80)
- # v_d5_5 = v[:, 5, 4, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d5_5 = dT_dx[:, 5, 4, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d5_5 = dT_dy[:, 5, 4, :, :].reshape(-1, 1, 40, 80)
- # Q_5 = Q[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # h_m_5 = h_m[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # T_d_5 = T_d[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # w_e_5 = w_e[:, :, 4, :, :].reshape(-1, 1, 40, 80)
-
- # data_5_5 = u_d5_5 * (dT_dx_d5_5)
- # out_5_5 = model(data_5_5)
-
- # dT_dt_5_5 = Q_5 / (1025 * 4000 * h_m_5) + v_d5_5 * (dT_dy_d5_5) + out_5_5 + w_e_5 * ((T_m_d5_5 - T_d_5) / h_m_5)
-
- # #深度5,天数6
- # T_m_d5_6 = T_m[:, 5, 5, :, :].reshape(-1, 1, 40, 80)
- # u_d5_6 = u[:, 5, 5, :, :].reshape(-1, 1, 40, 80)
- # v_d5_6 = v[:, 5, 5, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d5_6 = dT_dx[:, 5, 5, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d5_6 = dT_dy[:, 5, 5, :, :].reshape(-1, 1, 40, 80)
- # Q_6 = Q[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # h_m_6 = h_m[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # T_d_6 = T_d[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # w_e_6 = w_e[:, :, 5, :, :].reshape(-1, 1, 40, 80)
-
- # data_5_6 = u_d5_6 * (dT_dx_d5_6)
- # out_5_6 = model(data_5_6)
-
- # dT_dt_5_6 = Q_6 / (1025 * 4000 * h_m_6) + v_d5_6 * (dT_dy_d5_6) + out_5_6 + w_e_6 * ((T_m_d5_6 - T_d_6) / h_m_6)
-
- # #深度5,天数7
- # T_m_d5_7 = T_m[:, 5, 6, :, :].reshape(-1, 1, 40, 80)
- # u_d5_7 = u[:, 5, 6, :, :].reshape(-1, 1, 40, 80)
- # v_d5_7 = v[:, 5, 6, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d5_7 = dT_dx[:, 5, 6, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d5_7 = dT_dy[:, 5, 6, :, :].reshape(-1, 1, 40, 80)
- # Q_7 = Q[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # h_m_7 = h_m[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # T_d_7 = T_d[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # w_e_7 = w_e[:, :, 6, :, :].reshape(-1, 1, 40, 80)
-
- # data_5_7 = u_d5_7 * (dT_dx_d5_7)
- # out_5_7 = model(data_5_7)
-
- # dT_dt_5_7 = Q_7 / (1025 * 4000 * h_m_7) + v_d5_7 * (dT_dy_d5_7) + out_5_7 + w_e_7 * ((T_m_d5_7 - T_d_7) / h_m_7)
-
- # #深度6,天数1
- # T_m_d6_1 = T_m[:, 6, 0, :, :].reshape(-1, 1, 40, 80)
- # u_d6_1 = u[:, 6, 0, :, :].reshape(-1, 1, 40, 80)
- # v_d6_1 = v[:, 6, 0, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d6_1 = dT_dx[:, 6, 0, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d6_1 = dT_dy[:, 6, 0, :, :].reshape(-1, 1, 40, 80)
- # Q_1 = Q[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # h_m_1 = h_m[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # T_d_1 = T_d[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # w_e_1 = w_e[:, :, 0, :, :].reshape(-1, 1, 40, 80)
-
- # data_6_1 = u_d6_1 * (dT_dx_d6_1)
- # out_6_1 = model(data_6_1)
-
- # dT_dt_6_1 = Q_1 / (1025 * 4000 * h_m_1) + v_d6_1 * (dT_dy_d6_1) + out_6_1 + w_e_1 * ((T_m_d6_1 - T_d_1) / h_m_1)
-
- # #深度6,天数2
- # T_m_d6_2 = T_m[:, 6, 1, :, :].reshape(-1, 1, 40, 80)
- # u_d6_2 = u[:, 6, 1, :, :].reshape(-1, 1, 40, 80)
- # v_d6_2 = v[:, 6, 1, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d6_2 = dT_dx[:, 6, 1, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d6_2 = dT_dy[:, 6, 1, :, :].reshape(-1, 1, 40, 80)
- # Q_2 = Q[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # h_m_2 = h_m[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # T_d_2 = T_d[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # w_e_2 = w_e[:, :, 1, :, :].reshape(-1, 1, 40, 80)
-
- # data_6_2 = u_d6_2 * (dT_dx_d6_2)
- # out_6_2 = model(data_6_2)
-
- # dT_dt_6_2 = Q_2 / (1025 * 4000 * h_m_2) + v_d6_2 * (dT_dy_d6_2) + out_6_2 + w_e_2 * ((T_m_d6_2 - T_d_2) / h_m_2)
-
- # #深度6,天数3
- # T_m_d6_3 = T_m[:, 6, 2, :, :].reshape(-1, 1, 40, 80)
- # u_d6_3 = u[:, 6, 2, :, :].reshape(-1, 1, 40, 80)
- # v_d6_3 = v[:, 6, 2, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d6_3 = dT_dx[:, 6, 2, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d6_3 = dT_dy[:, 6, 2, :, :].reshape(-1, 1, 40, 80)
- # Q_3 = Q[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # h_m_3 = h_m[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # T_d_3 = T_d[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # w_e_3 = w_e[:, :, 2, :, :].reshape(-1, 1, 40, 80)
-
- # data_6_3 = u_d6_3 * (dT_dx_d6_3)
- # out_6_3 = model(data_6_3)
-
- # dT_dt_6_3 = Q_3 / (1025 * 4000 * h_m_3) + v_d6_3 * (dT_dy_d6_3) + out_6_3 + w_e_3 * ((T_m_d6_3 - T_d_3) / h_m_3)
-
- # #深度6,天数4
- # T_m_d6_4 = T_m[:, 6, 3, :, :].reshape(-1, 1, 40, 80)
- # u_d6_4 = u[:, 6, 3, :, :].reshape(-1, 1, 40, 80)
- # v_d6_4 = v[:, 6, 3, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d6_4 = dT_dx[:, 6, 3, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d6_4 = dT_dy[:, 6, 3, :, :].reshape(-1, 1, 40, 80)
- # Q_4 = Q[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # h_m_4 = h_m[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # T_d_4 = T_d[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # w_e_4 = w_e[:, :, 3, :, :].reshape(-1, 1, 40, 80)
-
- # data_6_4 = u_d6_4 * (dT_dx_d6_4)
- # out_6_4 = model(data_6_4)
-
- # dT_dt_6_4 = Q_4 / (1025 * 4000 * h_m_4) + v_d6_4 * (dT_dy_d6_4) + out_6_4 + w_e_4 * ((T_m_d6_4 - T_d_4) / h_m_4)
-
- # #深度6,天数5
- # T_m_d6_5 = T_m[:, 6, 4, :, :].reshape(-1, 1, 40, 80)
- # u_d6_5 = u[:, 6, 4, :, :].reshape(-1, 1, 40, 80)
- # v_d6_5 = v[:, 6, 4, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d6_5 = dT_dx[:, 6, 4, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d6_5 = dT_dy[:, 6, 4, :, :].reshape(-1, 1, 40, 80)
- # Q_5 = Q[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # h_m_5 = h_m[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # T_d_5 = T_d[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # w_e_5 = w_e[:, :, 4, :, :].reshape(-1, 1, 40, 80)
-
- # data_6_5 = u_d6_5 * (dT_dx_d6_5)
- # out_6_5 = model(data_6_5)
-
- # dT_dt_6_5 = Q_5 / (1025 * 4000 * h_m_5) + v_d6_5 * (dT_dy_d6_5) + out_6_5 + w_e_5 * ((T_m_d6_5 - T_d_5) / h_m_5)
-
- # #深度6,天数6
- # T_m_d6_6 = T_m[:, 6, 5, :, :].reshape(-1, 1, 40, 80)
- # u_d6_6 = u[:, 6, 5, :, :].reshape(-1, 1, 40, 80)
- # v_d6_6 = v[:, 6, 5, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d6_6 = dT_dx[:, 6, 5, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d6_6 = dT_dy[:, 6, 5, :, :].reshape(-1, 1, 40, 80)
- # Q_6 = Q[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # h_m_6 = h_m[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # T_d_6 = T_d[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # w_e_6 = w_e[:, :, 5, :, :].reshape(-1, 1, 40, 80)
-
- # data_6_6 = u_d6_6 * (dT_dx_d6_6)
- # out_6_6 = model(data_6_6)
-
- # dT_dt_6_6 = Q_6 / (1025 * 4000 * h_m_6) + v_d6_6 * (dT_dy_d6_6) + out_6_6 + w_e_6 * ((T_m_d6_6 - T_d_6) / h_m_6)
-
- # #深度6,天数7
- # T_m_d6_7 = T_m[:, 6, 6, :, :].reshape(-1, 1, 40, 80)
- # u_d6_7 = u[:, 6, 6, :, :].reshape(-1, 1, 40, 80)
- # v_d6_7 = v[:, 6, 6, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d6_7 = dT_dx[:, 6, 6, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d6_7 = dT_dy[:, 6, 6, :, :].reshape(-1, 1, 40, 80)
- # Q_7 = Q[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # h_m_7 = h_m[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # T_d_7 = T_d[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # w_e_7 = w_e[:, :, 6, :, :].reshape(-1, 1, 40, 80)
-
- # data_6_7 = u_d6_7 * (dT_dx_d6_7)
- # out_6_7 = model(data_6_7)
-
- # dT_dt_6_7 = Q_7 / (1025 * 4000 * h_m_7) + v_d6_7 * (dT_dy_d6_7) + out_6_7 + w_e_7 * ((T_m_d6_7 - T_d_7) / h_m_7)
-
- # # #表面
- # # dT_dt_0_1 = list1[0]; dT_dt_0_2 = list1[1]; dT_dt_0_3 = list1[2]; dT_dt_0_4 = list1[3]; dT_dt_0_5 = list1[4]; dT_dt_0_6 = list1[5]; dT_dt_0_7 = list1[6]
-
- # # #layer1
- # # dT_dt_1_1 = list1[7]; dT_dt_1_2 = list1[8]; dT_dt_1_3 = list1[9]; dT_dt_1_4 = list1[10]; dT_dt_1_5 = list1[11]; dT_dt_1_6 = list1[12]; dT_dt_1_7 = list1[13]
-
- # # # layer2
- # # dT_dt_2_1 = list1[14]; dT_dt_2_2 = list1[15]; dT_dt_2_3 = list1[16]; dT_dt_2_4 = list1[17]; dT_dt_2_5 = list1[18]; dT_dt_2_6 = list1[19]; dT_dt_2_7 = list1[20]
-
- # # # layer3
- # # dT_dt_3_1 = list1[21]; dT_dt_3_2 = list1[22]; dT_dt_3_3 = list1[23]; dT_dt_3_4 = list1[24]; dT_dt_3_5 = list1[25]; dT_dt_3_6 = list1[26]; dT_dt_3_7 = list1[27]
-
- # # # layer4
- # # dT_dt_4_1 = list1[28]; dT_dt_4_2 = list1[29]; dT_dt_4_3 = list1[30]; dT_dt_4_4 = list1[31]; dT_dt_4_5 = list1[32]; dT_dt_4_6 = list1[33]; dT_dt_4_7 = list1[34]
-
- # # # layer5
- # # dT_dt_5_1 = list1[35]; dT_dt_5_2 = list1[36]; dT_dt_5_3 = list1[37]; dT_dt_5_4 = list1[38]; dT_dt_5_5 = list1[39]; dT_dt_5_6 = list1[40]; dT_dt_5_7 = list1[41]
-
- # # # layer5
- # # dT_dt_6_1 = list1[42]; dT_dt_6_2 = list1[43]; dT_dt_6_3 = list1[44]; dT_dt_6_4 = list1[45]; dT_dt_6_5 = list1[46]; dT_dt_6_6 = list1[47]; dT_dt_6_7 = list1[48]
-
- # alpha = 0.1
- # beta = 0.9
- # T_8_0 = alpha * (alpha * (alpha * (alpha * (alpha * (alpha * dT_dt_0_1 + beta * dT_dt_0_2) + beta * dT_dt_0_3) + beta * dT_dt_0_4) + beta * dT_dt_0_5) + beta * dT_dt_0_6) + beta * dT_dt_0_7 + T_m[:, 0, 6, :, :].reshape(-1,1,40,80)
- # T_8_1 = alpha * (alpha * (alpha * (alpha * (alpha * (alpha * dT_dt_1_1 + beta * dT_dt_1_2) + beta * dT_dt_1_3) + beta * dT_dt_1_4) + beta * dT_dt_1_5) + beta * dT_dt_1_6) + beta * dT_dt_1_7 + T_m[:, 1, 6, :, :].reshape(-1,1,40,80)
- # T_8_2 = alpha * (alpha * (alpha * (alpha * (alpha * (alpha * dT_dt_2_1 + beta * dT_dt_2_2) + beta * dT_dt_2_3) + beta * dT_dt_2_4) + beta * dT_dt_2_5) + beta * dT_dt_2_6) + beta * dT_dt_2_7 + T_m[:, 2, 6, :, :].reshape(-1,1,40,80)
- # T_8_3 = alpha * (alpha * (alpha * (alpha * (alpha * (alpha * dT_dt_3_1 + beta * dT_dt_3_2) + beta * dT_dt_3_3) + beta * dT_dt_3_4) + beta * dT_dt_3_5) + beta * dT_dt_3_6) + beta * dT_dt_3_7 + T_m[:, 3, 6, :, :].reshape(-1,1,40,80)
- # T_8_4 = alpha * (alpha * (alpha * (alpha * (alpha * (alpha * dT_dt_4_1 + beta * dT_dt_4_2) + beta * dT_dt_4_3) + beta * dT_dt_4_4) + beta * dT_dt_4_5) + beta * dT_dt_4_6) + beta * dT_dt_4_7 + T_m[:, 4, 6, :, :].reshape(-1,1,40,80)
- # T_8_5 = alpha * (alpha * (alpha * (alpha * (alpha * (alpha * dT_dt_5_1 + beta * dT_dt_5_2) + beta * dT_dt_5_3) + beta * dT_dt_5_4) + beta * dT_dt_5_5) + beta * dT_dt_5_6) + beta * dT_dt_5_7 + T_m[:, 5, 6, :, :].reshape(-1,1,40,80)
- # T_8_6 = alpha * (alpha * (alpha * (alpha * (alpha * (alpha * dT_dt_6_1 + beta * dT_dt_6_2) + beta * dT_dt_6_3) + beta * dT_dt_6_4) + beta * dT_dt_6_5) + beta * dT_dt_6_6) + beta * dT_dt_6_7 + T_m[:, 6, 6, :, :].reshape(-1,1,40,80)
-
- # T_8_all = torch.cat((T_8_0,T_8_1,T_8_2,T_8_3,T_8_4,T_8_4,T_8_6), dim=1)
- # # print('T_8_all.shape:{}'.format(T_8_all.shape)) # T_8_0.shape:torch.Size([32, 1, 40, 80])
-
- # label_8 = label[:,:,0,:,:]
- # # print('label_8.shape:{}'.format(label_8.shape)) # label.shape:torch.Size([32, 7, 10, 40, 80])
-
- # loss = criterion(T_8_all, label_8)
-
- # losses += loss
- # #print(loss)
- # # 反向传播
- # loss.backward()
- # optimizer.step()
-
- # train_loss = losses / len(trainloader)
- # train_losses.append(train_loss)
-
- # print('Training Loss: {:.10f}'.format(train_loss))
-
- # #Validation
-
- # model.eval()
- # losses = 0
-
- # for d, data in tqdm(enumerate(validloader)):
- # data, label = data
- # data = data.cuda()
- # label = label.cuda()
- # optimizer.zero_grad()
-
- # T_m = data[:, 0:7, :, :, :].reshape(-1, 7, 7, 40, 80)
- # Q = data[:, 7:8, :, :, :].reshape(-1, 1, 7, 40, 80)
- # h_m = data[:, 8:9, :, :, :].reshape(-1, 1, 7, 40, 80)
- # u = data[:, 9:16, :, :, :].reshape(-1, 7, 7, 40, 80)
- # v = data[:, 16:23, :, :, :].reshape(-1, 7, 7, 40, 80)
- # T_d = data[:, 23:24, :, :, :].reshape(-1, 1, 7, 40, 80)
- # w_e = data[:, 24:25, :, :, :].reshape(-1, 1, 7, 40, 80)
- # dT_dt = data[:, 25:32, :, :, :].reshape(-1, 7, 7, 40, 80)
- # dT_dx = data[:, 32:39, :, :, :].reshape(-1, 7, 7, 40, 80)
- # dT_dy = data[:, 39:, :, :, :].reshape(-1, 7, 7, 40, 80)
- # # print('data_test.shape:{}'.format(data.shape)) # T_8_0_test.shape:torch.Size([29, 1, 40, 80])
-
- # # 表面数据 ----第一天 到7天
- # # list1 = [] # 存dT_1 ... dT_6 与计算的loss
- # # for j in range(7): # 7个深度
- # # for i in range(7):
- # # T_m_dj_i = T_m[:, j, i, :, :].reshape(-1, 1, 40, 80)
- # # u_dj_i = u[:, j, i, :, :].reshape(-1, 1, 40, 80)
- # # v_dj_i = v[:, j, i, :, :].reshape(-1, 1, 40, 80)
- # # # dT_dt_dj_i = dT_dt[:, j, i, :, :].reshape(-1, 1, 40, 80) # 过去七天也不可知dT_dt7
- # # dT_dx_dj_i = dT_dx[:, j, i, :, :].reshape(-1, 1, 40, 80)
- # # dT_dy_dj_i = dT_dy[:, j, i, :, :].reshape(-1, 1, 40, 80)
- # # Q_i = Q[:, :, i, :, :].reshape(-1, 1, 40, 80)
- # # h_m_i = h_m[:, :, i, :, :].reshape(-1, 1, 40, 80)
- # # T_d_i = T_d[:, :, i, :, :].reshape(-1, 1, 40, 80)
- # # w_e_i = w_e[:, :, i, :, :].reshape(-1, 1, 40, 80)
-
- # # data_j_i = u_dj_i * (dT_dx_dj_i)
-
- # # out_j_i = model(data_j_i)
-
- # # dT_dti = Q_i / (1025 * 4000 * h_m_i) + v_dj_i * (dT_dy_dj_i) + out_j_i + w_e_i * ((T_m_dj_i - T_d_i) / h_m_i)
- # # # print(dT_dti.shape)
- # # list1.append(dT_dti)
-
- # #深度0,天数1
- # T_m_d0_1 = T_m[:, 0, 0, :, :].reshape(-1, 1, 40, 80)
- # u_d0_1 = u[:, 0, 0, :, :].reshape(-1, 1, 40, 80)
- # v_d0_1 = v[:, 0, 0, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d0_1 = dT_dx[:, 0, 0, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d0_1 = dT_dy[:, 0, 0, :, :].reshape(-1, 1, 40, 80)
- # Q_1 = Q[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # h_m_1 = h_m[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # T_d_1 = T_d[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # w_e_1 = w_e[:, :, 0, :, :].reshape(-1, 1, 40, 80)
-
- # data_0_1 = u_d0_1 * (dT_dx_d0_1)
- # out_0_1 = model(data_0_1)
-
- # dT_dt_0_1 = Q_1 / (1025 * 4000 * h_m_1) + v_d0_1 * (dT_dy_d0_1) + out_0_1 + w_e_1 * ((T_m_d0_1 - T_d_1) / h_m_1)
-
- # #深度0,天数2
- # T_m_d0_2 = T_m[:, 0, 1, :, :].reshape(-1, 1, 40, 80)
- # u_d0_2 = u[:, 0, 1, :, :].reshape(-1, 1, 40, 80)
- # v_d0_2 = v[:, 0, 1, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d0_2 = dT_dx[:, 0, 1, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d0_2 = dT_dy[:, 0, 1, :, :].reshape(-1, 1, 40, 80)
- # Q_2 = Q[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # h_m_2 = h_m[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # T_d_2 = T_d[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # w_e_2 = w_e[:, :, 1, :, :].reshape(-1, 1, 40, 80)
-
- # data_0_2 = u_d0_2 * (dT_dx_d0_2)
- # out_0_2 = model(data_0_2)
-
- # dT_dt_0_2 = Q_2 / (1025 * 4000 * h_m_2) + v_d0_2 * (dT_dy_d0_2) + out_0_2 + w_e_2 * ((T_m_d0_2 - T_d_2) / h_m_2)
-
- # #深度0,天数3
- # T_m_d0_3 = T_m[:, 0, 2, :, :].reshape(-1, 1, 40, 80)
- # u_d0_3 = u[:, 0, 2, :, :].reshape(-1, 1, 40, 80)
- # v_d0_3 = v[:, 0, 2, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d0_3 = dT_dx[:, 0, 2, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d0_3 = dT_dy[:, 0, 2, :, :].reshape(-1, 1, 40, 80)
- # Q_3 = Q[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # h_m_3 = h_m[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # T_d_3 = T_d[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # w_e_3 = w_e[:, :, 2, :, :].reshape(-1, 1, 40, 80)
-
- # data_0_3 = u_d0_3 * (dT_dx_d0_3)
- # out_0_3 = model(data_0_3)
-
- # dT_dt_0_3 = Q_3 / (1025 * 4000 * h_m_3) + v_d0_3 * (dT_dy_d0_3) + out_0_3 + w_e_3 * ((T_m_d0_3 - T_d_3) / h_m_3)
-
- # #深度0,天数4
- # T_m_d0_4 = T_m[:, 0, 3, :, :].reshape(-1, 1, 40, 80)
- # u_d0_4 = u[:, 0, 3, :, :].reshape(-1, 1, 40, 80)
- # v_d0_4 = v[:, 0, 3, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d0_4 = dT_dx[:, 0, 3, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d0_4 = dT_dy[:, 0, 3, :, :].reshape(-1, 1, 40, 80)
- # Q_4 = Q[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # h_m_4 = h_m[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # T_d_4 = T_d[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # w_e_4 = w_e[:, :, 3, :, :].reshape(-1, 1, 40, 80)
-
- # data_0_4 = u_d0_4 * (dT_dx_d0_4)
- # out_0_4 = model(data_0_4)
-
- # dT_dt_0_4 = Q_4 / (1025 * 4000 * h_m_4) + v_d0_4 * (dT_dy_d0_4) + out_0_4 + w_e_4 * ((T_m_d0_4 - T_d_4) / h_m_4)
-
- # #深度0,天数5
- # T_m_d0_5 = T_m[:, 0, 4, :, :].reshape(-1, 1, 40, 80)
- # u_d0_5 = u[:, 0, 4, :, :].reshape(-1, 1, 40, 80)
- # v_d0_5 = v[:, 0, 4, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d0_5 = dT_dx[:, 0, 4, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d0_5 = dT_dy[:, 0, 4, :, :].reshape(-1, 1, 40, 80)
- # Q_5 = Q[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # h_m_5 = h_m[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # T_d_5 = T_d[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # w_e_5 = w_e[:, :, 4, :, :].reshape(-1, 1, 40, 80)
-
- # data_0_5 = u_d0_5 * (dT_dx_d0_5)
- # out_0_5 = model(data_0_5)
-
- # dT_dt_0_5 = Q_5 / (1025 * 4000 * h_m_5) + v_d0_5 * (dT_dy_d0_5) + out_0_5 + w_e_5 * ((T_m_d0_5 - T_d_5) / h_m_5)
-
- # #深度0,天数6
- # T_m_d0_6 = T_m[:, 0, 5, :, :].reshape(-1, 1, 40, 80)
- # u_d0_6 = u[:, 0, 5, :, :].reshape(-1, 1, 40, 80)
- # v_d0_6 = v[:, 0, 5, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d0_6 = dT_dx[:, 0, 5, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d0_6 = dT_dy[:, 0, 5, :, :].reshape(-1, 1, 40, 80)
- # Q_6 = Q[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # h_m_6 = h_m[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # T_d_6 = T_d[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # w_e_6 = w_e[:, :, 5, :, :].reshape(-1, 1, 40, 80)
-
- # data_0_6 = u_d0_6 * (dT_dx_d0_6)
- # out_0_6 = model(data_0_6)
-
- # dT_dt_0_6 = Q_6 / (1025 * 4000 * h_m_6) + v_d0_6 * (dT_dy_d0_6) + out_0_6 + w_e_6 * ((T_m_d0_6 - T_d_6) / h_m_6)
-
- # #深度0,天数7
- # T_m_d0_7 = T_m[:, 0, 6, :, :].reshape(-1, 1, 40, 80)
- # u_d0_7 = u[:, 0, 6, :, :].reshape(-1, 1, 40, 80)
- # v_d0_7 = v[:, 0, 6, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d0_7 = dT_dx[:, 0, 6, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d0_7 = dT_dy[:, 0, 6, :, :].reshape(-1, 1, 40, 80)
- # Q_7 = Q[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # h_m_7 = h_m[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # T_d_7 = T_d[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # w_e_7 = w_e[:, :, 6, :, :].reshape(-1, 1, 40, 80)
-
- # data_0_7 = u_d0_7 * (dT_dx_d0_7)
- # out_0_7 = model(data_0_7)
-
- # dT_dt_0_7 = Q_7 / (1025 * 4000 * h_m_7) + v_d0_7 * (dT_dy_d0_7) + out_0_7 + w_e_7 * ((T_m_d0_7 - T_d_7) / h_m_7)
-
- # #深度1,天数1
- # T_m_d1_1 = T_m[:, 1, 0, :, :].reshape(-1, 1, 40, 80)
- # u_d1_1 = u[:, 1, 0, :, :].reshape(-1, 1, 40, 80)
- # v_d1_1 = v[:, 1, 0, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d1_1 = dT_dx[:, 1, 0, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d1_1 = dT_dy[:, 1, 0, :, :].reshape(-1, 1, 40, 80)
- # Q_1 = Q[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # h_m_1 = h_m[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # T_d_1 = T_d[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # w_e_1 = w_e[:, :, 0, :, :].reshape(-1, 1, 40, 80)
-
- # data_1_1 = u_d1_1 * (dT_dx_d1_1)
- # out_1_1 = model(data_1_1)
-
- # dT_dt_1_1 = Q_1 / (1025 * 4000 * h_m_1) + v_d1_1 * (dT_dy_d1_1) + out_1_1 + w_e_1 * ((T_m_d1_1 - T_d_1) / h_m_1)
-
- # #深度1,天数2
- # T_m_d1_2 = T_m[:, 1, 1, :, :].reshape(-1, 1, 40, 80)
- # u_d1_2 = u[:, 1, 1, :, :].reshape(-1, 1, 40, 80)
- # v_d1_2 = v[:, 1, 1, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d1_2 = dT_dx[:, 1, 1, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d1_2 = dT_dy[:, 1, 1, :, :].reshape(-1, 1, 40, 80)
- # Q_2 = Q[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # h_m_2 = h_m[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # T_d_2 = T_d[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # w_e_2 = w_e[:, :, 1, :, :].reshape(-1, 1, 40, 80)
-
- # data_1_2 = u_d1_2 * (dT_dx_d1_2)
- # out_1_2 = model(data_1_2)
-
- # dT_dt_1_2 = Q_2 / (1025 * 4000 * h_m_2) + v_d1_2 * (dT_dy_d1_2) + out_1_2 + w_e_2 * ((T_m_d1_2 - T_d_2) / h_m_2)
-
- # #深度1,天数3
- # T_m_d1_3 = T_m[:, 1, 2, :, :].reshape(-1, 1, 40, 80)
- # u_d1_3 = u[:, 1, 2, :, :].reshape(-1, 1, 40, 80)
- # v_d1_3 = v[:, 1, 2, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d1_3 = dT_dx[:, 1, 2, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d1_3 = dT_dy[:, 1, 2, :, :].reshape(-1, 1, 40, 80)
- # Q_3 = Q[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # h_m_3 = h_m[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # T_d_3 = T_d[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # w_e_3 = w_e[:, :, 2, :, :].reshape(-1, 1, 40, 80)
-
- # data_1_3 = u_d1_3 * (dT_dx_d1_3)
- # out_1_3 = model(data_1_3)
-
- # dT_dt_1_3 = Q_3 / (1025 * 4000 * h_m_3) + v_d1_3 * (dT_dy_d1_3) + out_1_3 + w_e_3 * ((T_m_d1_3 - T_d_3) / h_m_3)
-
- # #深度1,天数4
- # T_m_d1_4 = T_m[:, 1, 3, :, :].reshape(-1, 1, 40, 80)
- # u_d1_4 = u[:, 1, 3, :, :].reshape(-1, 1, 40, 80)
- # v_d1_4 = v[:, 1, 3, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d1_4 = dT_dx[:, 1, 3, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d1_4 = dT_dy[:, 1, 3, :, :].reshape(-1, 1, 40, 80)
- # Q_4 = Q[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # h_m_4 = h_m[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # T_d_4 = T_d[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # w_e_4 = w_e[:, :, 3, :, :].reshape(-1, 1, 40, 80)
-
- # data_1_4 = u_d1_4 * (dT_dx_d1_4)
- # out_1_4 = model(data_1_4)
-
- # dT_dt_1_4 = Q_4 / (1025 * 4000 * h_m_4) + v_d1_4 * (dT_dy_d1_4) + out_1_4 + w_e_4 * ((T_m_d1_4 - T_d_4) / h_m_4)
-
- # #深度1,天数5
- # T_m_d1_5 = T_m[:, 1, 4, :, :].reshape(-1, 1, 40, 80)
- # u_d1_5 = u[:, 1, 4, :, :].reshape(-1, 1, 40, 80)
- # v_d1_5 = v[:, 1, 4, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d1_5 = dT_dx[:, 1, 4, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d1_5 = dT_dy[:, 1, 4, :, :].reshape(-1, 1, 40, 80)
- # Q_5 = Q[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # h_m_5 = h_m[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # T_d_5 = T_d[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # w_e_5 = w_e[:, :, 4, :, :].reshape(-1, 1, 40, 80)
-
- # data_1_5 = u_d1_5 * (dT_dx_d1_5)
- # out_1_5 = model(data_1_5)
-
- # dT_dt_1_5 = Q_5 / (1025 * 4000 * h_m_5) + v_d1_5 * (dT_dy_d1_5) + out_1_5 + w_e_5 * ((T_m_d1_5 - T_d_5) / h_m_5)
-
- # #深度1,天数6
- # T_m_d1_6 = T_m[:, 1, 5, :, :].reshape(-1, 1, 40, 80)
- # u_d1_6 = u[:, 1, 5, :, :].reshape(-1, 1, 40, 80)
- # v_d1_6 = v[:, 1, 5, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d1_6 = dT_dx[:, 1, 5, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d1_6 = dT_dy[:, 1, 5, :, :].reshape(-1, 1, 40, 80)
- # Q_6 = Q[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # h_m_6 = h_m[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # T_d_6 = T_d[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # w_e_6 = w_e[:, :, 5, :, :].reshape(-1, 1, 40, 80)
-
- # data_1_6 = u_d1_6 * (dT_dx_d1_6)
- # out_1_6 = model(data_1_6)
-
- # dT_dt_1_6 = Q_6 / (1025 * 4000 * h_m_6) + v_d1_6 * (dT_dy_d1_6) + out_1_6 + w_e_6 * ((T_m_d1_6 - T_d_6) / h_m_6)
-
- # #深度1,天数7
- # T_m_d1_7 = T_m[:, 1, 6, :, :].reshape(-1, 1, 40, 80)
- # u_d1_7 = u[:, 1, 6, :, :].reshape(-1, 1, 40, 80)
- # v_d1_7 = v[:, 1, 6, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d1_7 = dT_dx[:, 1, 6, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d1_7 = dT_dy[:, 1, 6, :, :].reshape(-1, 1, 40, 80)
- # Q_7 = Q[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # h_m_7 = h_m[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # T_d_7 = T_d[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # w_e_7 = w_e[:, :, 6, :, :].reshape(-1, 1, 40, 80)
-
- # data_1_7 = u_d1_7 * (dT_dx_d1_7)
- # out_1_7 = model(data_1_7)
-
- # dT_dt_1_7 = Q_7 / (1025 * 4000 * h_m_7) + v_d1_7 * (dT_dy_d1_7) + out_1_7 + w_e_7 * ((T_m_d1_7 - T_d_7) / h_m_7)
-
- # #深度2,天数1
- # T_m_d2_1 = T_m[:, 2, 0, :, :].reshape(-1, 1, 40, 80)
- # u_d2_1 = u[:, 2, 0, :, :].reshape(-1, 1, 40, 80)
- # v_d2_1 = v[:, 2, 0, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d2_1 = dT_dx[:, 2, 0, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d2_1 = dT_dy[:, 2, 0, :, :].reshape(-1, 1, 40, 80)
- # Q_1 = Q[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # h_m_1 = h_m[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # T_d_1 = T_d[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # w_e_1 = w_e[:, :, 0, :, :].reshape(-1, 1, 40, 80)
-
- # data_2_1 = u_d2_1 * (dT_dx_d2_1)
- # out_2_1 = model(data_2_1)
-
- # dT_dt_2_1 = Q_1 / (1025 * 4000 * h_m_1) + v_d2_1 * (dT_dy_d2_1) + out_2_1 + w_e_1 * ((T_m_d2_1 - T_d_1) / h_m_1)
-
- # #深度2,天数2
- # T_m_d2_2 = T_m[:, 2, 1, :, :].reshape(-1, 1, 40, 80)
- # u_d2_2 = u[:, 2, 1, :, :].reshape(-1, 1, 40, 80)
- # v_d2_2 = v[:, 2, 1, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d2_2 = dT_dx[:, 2, 1, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d2_2 = dT_dy[:, 2, 1, :, :].reshape(-1, 1, 40, 80)
- # Q_2 = Q[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # h_m_2 = h_m[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # T_d_2 = T_d[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # w_e_2 = w_e[:, :, 1, :, :].reshape(-1, 1, 40, 80)
-
- # data_2_2 = u_d2_2 * (dT_dx_d2_2)
- # out_2_2 = model(data_2_2)
-
- # dT_dt_2_2 = Q_2 / (1025 * 4000 * h_m_2) + v_d2_2 * (dT_dy_d2_2) + out_2_2 + w_e_2 * ((T_m_d2_2 - T_d_2) / h_m_2)
-
- # #深度2,天数3
- # T_m_d2_3 = T_m[:, 2, 2, :, :].reshape(-1, 1, 40, 80)
- # u_d2_3 = u[:, 2, 2, :, :].reshape(-1, 1, 40, 80)
- # v_d2_3 = v[:, 2, 2, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d2_3 = dT_dx[:, 2, 2, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d2_3 = dT_dy[:, 2, 2, :, :].reshape(-1, 1, 40, 80)
- # Q_3 = Q[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # h_m_3 = h_m[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # T_d_3 = T_d[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # w_e_3 = w_e[:, :, 2, :, :].reshape(-1, 1, 40, 80)
-
- # data_2_3 = u_d2_3 * (dT_dx_d2_3)
- # out_2_3 = model(data_2_3)
-
- # dT_dt_2_3 = Q_3 / (1025 * 4000 * h_m_3) + v_d2_3 * (dT_dy_d2_3) + out_2_3 + w_e_3 * ((T_m_d2_3 - T_d_3) / h_m_3)
-
- # #深度2,天数4
- # T_m_d2_4 = T_m[:, 2, 3, :, :].reshape(-1, 1, 40, 80)
- # u_d2_4 = u[:, 2, 3, :, :].reshape(-1, 1, 40, 80)
- # v_d2_4 = v[:, 2, 3, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d2_4 = dT_dx[:, 2, 3, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d2_4 = dT_dy[:, 2, 3, :, :].reshape(-1, 1, 40, 80)
- # Q_4 = Q[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # h_m_4 = h_m[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # T_d_4 = T_d[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # w_e_4 = w_e[:, :, 3, :, :].reshape(-1, 1, 40, 80)
-
- # data_2_4 = u_d2_4 * (dT_dx_d2_4)
- # out_2_4 = model(data_2_4)
-
- # dT_dt_2_4 = Q_4 / (1025 * 4000 * h_m_4) + v_d2_4 * (dT_dy_d2_4) + out_2_4 + w_e_4 * ((T_m_d2_4 - T_d_4) / h_m_4)
-
- # #深度2,天数5
- # T_m_d2_5 = T_m[:, 2, 4, :, :].reshape(-1, 1, 40, 80)
- # u_d2_5 = u[:, 2, 4, :, :].reshape(-1, 1, 40, 80)
- # v_d2_5 = v[:, 2, 4, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d2_5 = dT_dx[:, 2, 4, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d2_5 = dT_dy[:, 2, 4, :, :].reshape(-1, 1, 40, 80)
- # Q_5 = Q[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # h_m_5 = h_m[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # T_d_5 = T_d[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # w_e_5 = w_e[:, :, 4, :, :].reshape(-1, 1, 40, 80)
-
- # data_2_5 = u_d2_5 * (dT_dx_d2_5)
- # out_2_5 = model(data_2_5)
-
- # dT_dt_2_5 = Q_5 / (1025 * 4000 * h_m_5) + v_d2_5 * (dT_dy_d2_5) + out_2_5 + w_e_5 * ((T_m_d2_5 - T_d_5) / h_m_5)
-
- # #深度2,天数6
- # T_m_d2_6 = T_m[:, 2, 5, :, :].reshape(-1, 1, 40, 80)
- # u_d2_6 = u[:, 2, 5, :, :].reshape(-1, 1, 40, 80)
- # v_d2_6 = v[:, 2, 5, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d2_6 = dT_dx[:, 2, 5, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d2_6 = dT_dy[:, 2, 5, :, :].reshape(-1, 1, 40, 80)
- # Q_6 = Q[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # h_m_6 = h_m[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # T_d_6 = T_d[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # w_e_6 = w_e[:, :, 5, :, :].reshape(-1, 1, 40, 80)
-
- # data_2_6 = u_d2_6 * (dT_dx_d2_6)
- # out_2_6 = model(data_2_6)
-
- # dT_dt_2_6 = Q_6 / (1025 * 4000 * h_m_6) + v_d2_6 * (dT_dy_d2_6) + out_2_6 + w_e_6 * ((T_m_d2_6 - T_d_6) / h_m_6)
-
- # #深度2,天数7
- # T_m_d2_7 = T_m[:, 2, 6, :, :].reshape(-1, 1, 40, 80)
- # u_d2_7 = u[:, 2, 6, :, :].reshape(-1, 1, 40, 80)
- # v_d2_7 = v[:, 2, 6, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d2_7 = dT_dx[:, 2, 6, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d2_7 = dT_dy[:, 2, 6, :, :].reshape(-1, 1, 40, 80)
- # Q_7 = Q[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # h_m_7 = h_m[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # T_d_7 = T_d[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # w_e_7 = w_e[:, :, 6, :, :].reshape(-1, 1, 40, 80)
-
- # data_2_7 = u_d2_7 * (dT_dx_d2_7)
- # out_2_7 = model(data_2_7)
-
- # dT_dt_2_7 = Q_7 / (1025 * 4000 * h_m_7) + v_d2_7 * (dT_dy_d2_7) + out_2_7 + w_e_7 * ((T_m_d2_7 - T_d_7) / h_m_7)
-
- # #深度3,天数1
- # T_m_d3_1 = T_m[:, 3, 0, :, :].reshape(-1, 1, 40, 80)
- # u_d3_1 = u[:, 3, 0, :, :].reshape(-1, 1, 40, 80)
- # v_d3_1 = v[:, 3, 0, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d3_1 = dT_dx[:, 3, 0, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d3_1 = dT_dy[:, 3, 0, :, :].reshape(-1, 1, 40, 80)
- # Q_1 = Q[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # h_m_1 = h_m[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # T_d_1 = T_d[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # w_e_1 = w_e[:, :, 0, :, :].reshape(-1, 1, 40, 80)
-
- # data_3_1 = u_d3_1 * (dT_dx_d3_1)
- # out_3_1 = model(data_3_1)
-
- # dT_dt_3_1 = Q_1 / (1025 * 4000 * h_m_1) + v_d3_1 * (dT_dy_d3_1) + out_3_1 + w_e_1 * ((T_m_d3_1 - T_d_1) / h_m_1)
-
- # #深度3,天数2
- # T_m_d3_2 = T_m[:, 3, 1, :, :].reshape(-1, 1, 40, 80)
- # u_d3_2 = u[:, 3, 1, :, :].reshape(-1, 1, 40, 80)
- # v_d3_2 = v[:, 3, 1, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d3_2 = dT_dx[:, 3, 1, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d3_2 = dT_dy[:, 3, 1, :, :].reshape(-1, 1, 40, 80)
- # Q_2 = Q[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # h_m_2 = h_m[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # T_d_2 = T_d[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # w_e_2 = w_e[:, :, 1, :, :].reshape(-1, 1, 40, 80)
-
- # data_3_2 = u_d3_2 * (dT_dx_d3_2)
- # out_3_2 = model(data_3_2)
-
- # dT_dt_3_2 = Q_2 / (1025 * 4000 * h_m_2) + v_d3_2 * (dT_dy_d3_2) + out_3_2 + w_e_2 * ((T_m_d3_2 - T_d_2) / h_m_2)
-
- # #深度3,天数3
- # T_m_d3_3 = T_m[:, 3, 2, :, :].reshape(-1, 1, 40, 80)
- # u_d3_3 = u[:, 3, 2, :, :].reshape(-1, 1, 40, 80)
- # v_d3_3 = v[:, 3, 2, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d3_3 = dT_dx[:, 3, 2, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d3_3 = dT_dy[:, 3, 2, :, :].reshape(-1, 1, 40, 80)
- # Q_3 = Q[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # h_m_3 = h_m[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # T_d_3 = T_d[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # w_e_3 = w_e[:, :, 2, :, :].reshape(-1, 1, 40, 80)
-
- # data_3_3 = u_d3_3 * (dT_dx_d3_3)
- # out_3_3 = model(data_3_3)
-
- # dT_dt_3_3 = Q_3 / (1025 * 4000 * h_m_3) + v_d3_3 * (dT_dy_d3_3) + out_3_3 + w_e_3 * ((T_m_d3_3 - T_d_3) / h_m_3)
-
- # #深度3,天数4
- # T_m_d3_4 = T_m[:, 3, 3, :, :].reshape(-1, 1, 40, 80)
- # u_d3_4 = u[:, 3, 3, :, :].reshape(-1, 1, 40, 80)
- # v_d3_4 = v[:, 3, 3, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d3_4 = dT_dx[:, 3, 3, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d3_4 = dT_dy[:, 3, 3, :, :].reshape(-1, 1, 40, 80)
- # Q_4 = Q[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # h_m_4 = h_m[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # T_d_4 = T_d[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # w_e_4 = w_e[:, :, 3, :, :].reshape(-1, 1, 40, 80)
-
- # data_3_4 = u_d3_4 * (dT_dx_d3_4)
- # out_3_4 = model(data_3_4)
-
- # dT_dt_3_4 = Q_4 / (1025 * 4000 * h_m_4) + v_d3_4 * (dT_dy_d3_4) + out_3_4 + w_e_4 * ((T_m_d3_4 - T_d_4) / h_m_4)
-
- # #深度3,天数5
- # T_m_d3_5 = T_m[:, 3, 4, :, :].reshape(-1, 1, 40, 80)
- # u_d3_5 = u[:, 3, 4, :, :].reshape(-1, 1, 40, 80)
- # v_d3_5 = v[:, 3, 4, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d3_5 = dT_dx[:, 3, 4, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d3_5 = dT_dy[:, 3, 4, :, :].reshape(-1, 1, 40, 80)
- # Q_5 = Q[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # h_m_5 = h_m[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # T_d_5 = T_d[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # w_e_5 = w_e[:, :, 4, :, :].reshape(-1, 1, 40, 80)
-
- # data_3_5 = u_d3_5 * (dT_dx_d3_5)
- # out_3_5 = model(data_3_5)
-
- # dT_dt_3_5 = Q_5 / (1025 * 4000 * h_m_5) + v_d3_5 * (dT_dy_d3_5) + out_3_5 + w_e_5 * ((T_m_d3_5 - T_d_5) / h_m_5)
-
- # #深度3,天数6
- # T_m_d3_6 = T_m[:, 3, 5, :, :].reshape(-1, 1, 40, 80)
- # u_d3_6 = u[:, 3, 5, :, :].reshape(-1, 1, 40, 80)
- # v_d3_6 = v[:, 3, 5, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d3_6 = dT_dx[:, 3, 5, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d3_6 = dT_dy[:, 3, 5, :, :].reshape(-1, 1, 40, 80)
- # Q_6 = Q[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # h_m_6 = h_m[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # T_d_6 = T_d[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # w_e_6 = w_e[:, :, 5, :, :].reshape(-1, 1, 40, 80)
-
- # data_3_6 = u_d3_6 * (dT_dx_d3_6)
- # out_3_6 = model(data_3_6)
-
- # dT_dt_3_6 = Q_6 / (1025 * 4000 * h_m_6) + v_d3_6 * (dT_dy_d3_6) + out_3_6 + w_e_6 * ((T_m_d3_6 - T_d_6) / h_m_6)
-
- # #深度3,天数7
- # T_m_d3_7 = T_m[:, 3, 6, :, :].reshape(-1, 1, 40, 80)
- # u_d3_7 = u[:, 3, 6, :, :].reshape(-1, 1, 40, 80)
- # v_d3_7 = v[:, 3, 6, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d3_7 = dT_dx[:, 3, 6, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d3_7 = dT_dy[:, 3, 6, :, :].reshape(-1, 1, 40, 80)
- # Q_7 = Q[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # h_m_7 = h_m[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # T_d_7 = T_d[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # w_e_7 = w_e[:, :, 6, :, :].reshape(-1, 1, 40, 80)
-
- # data_3_7 = u_d3_7 * (dT_dx_d3_7)
- # out_3_7 = model(data_3_7)
-
- # dT_dt_3_7 = Q_7 / (1025 * 4000 * h_m_7) + v_d3_7 * (dT_dy_d3_7) + out_3_7 + w_e_7 * ((T_m_d3_7 - T_d_7) / h_m_7)
-
- # #深度4,天数1
- # T_m_d4_1 = T_m[:, 4, 0, :, :].reshape(-1, 1, 40, 80)
- # u_d4_1 = u[:, 4, 0, :, :].reshape(-1, 1, 40, 80)
- # v_d4_1 = v[:, 4, 0, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d4_1 = dT_dx[:, 4, 0, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d4_1 = dT_dy[:, 4, 0, :, :].reshape(-1, 1, 40, 80)
- # Q_1 = Q[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # h_m_1 = h_m[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # T_d_1 = T_d[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # w_e_1 = w_e[:, :, 0, :, :].reshape(-1, 1, 40, 80)
-
- # data_4_1 = u_d4_1 * (dT_dx_d4_1)
- # out_4_1 = model(data_4_1)
-
- # dT_dt_4_1 = Q_1 / (1025 * 4000 * h_m_1) + v_d4_1 * (dT_dy_d4_1) + out_4_1 + w_e_1 * ((T_m_d4_1 - T_d_1) / h_m_1)
-
- # #深度4,天数2
- # T_m_d4_2 = T_m[:, 4, 1, :, :].reshape(-1, 1, 40, 80)
- # u_d4_2 = u[:, 4, 1, :, :].reshape(-1, 1, 40, 80)
- # v_d4_2 = v[:, 4, 1, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d4_2 = dT_dx[:, 4, 1, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d4_2 = dT_dy[:, 4, 1, :, :].reshape(-1, 1, 40, 80)
- # Q_2 = Q[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # h_m_2 = h_m[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # T_d_2 = T_d[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # w_e_2 = w_e[:, :, 1, :, :].reshape(-1, 1, 40, 80)
-
- # data_4_2 = u_d4_2 * (dT_dx_d4_2)
- # out_4_2 = model(data_4_2)
-
- # dT_dt_4_2 = Q_2 / (1025 * 4000 * h_m_2) + v_d4_2 * (dT_dy_d4_2) + out_4_2 + w_e_2 * ((T_m_d4_2 - T_d_2) / h_m_2)
-
- # #深度4,天数3
- # T_m_d4_3 = T_m[:, 4, 2, :, :].reshape(-1, 1, 40, 80)
- # u_d4_3 = u[:, 4, 2, :, :].reshape(-1, 1, 40, 80)
- # v_d4_3 = v[:, 4, 2, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d4_3 = dT_dx[:, 4, 2, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d4_3 = dT_dy[:, 4, 2, :, :].reshape(-1, 1, 40, 80)
- # Q_3 = Q[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # h_m_3 = h_m[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # T_d_3 = T_d[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # w_e_3 = w_e[:, :, 2, :, :].reshape(-1, 1, 40, 80)
-
- # data_4_3 = u_d4_3 * (dT_dx_d4_3)
- # out_4_3 = model(data_4_3)
-
- # dT_dt_4_3 = Q_3 / (1025 * 4000 * h_m_3) + v_d4_3 * (dT_dy_d4_3) + out_4_3 + w_e_3 * ((T_m_d4_3 - T_d_3) / h_m_3)
-
- # #深度4,天数4
- # T_m_d4_4 = T_m[:, 4, 3, :, :].reshape(-1, 1, 40, 80)
- # u_d4_4 = u[:, 4, 3, :, :].reshape(-1, 1, 40, 80)
- # v_d4_4 = v[:, 4, 3, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d4_4 = dT_dx[:, 4, 3, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d4_4 = dT_dy[:, 4, 3, :, :].reshape(-1, 1, 40, 80)
- # Q_4 = Q[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # h_m_4 = h_m[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # T_d_4 = T_d[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # w_e_4 = w_e[:, :, 3, :, :].reshape(-1, 1, 40, 80)
-
- # data_4_4 = u_d4_4 * (dT_dx_d4_4)
- # out_4_4 = model(data_4_4)
-
- # dT_dt_4_4 = Q_4 / (1025 * 4000 * h_m_4) + v_d4_4 * (dT_dy_d4_4) + out_4_4 + w_e_4 * ((T_m_d4_4 - T_d_4) / h_m_4)
-
- # #深度4,天数5
- # T_m_d4_5 = T_m[:, 4, 4, :, :].reshape(-1, 1, 40, 80)
- # u_d4_5 = u[:, 4, 4, :, :].reshape(-1, 1, 40, 80)
- # v_d4_5 = v[:, 4, 4, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d4_5 = dT_dx[:, 4, 4, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d4_5 = dT_dy[:, 4, 4, :, :].reshape(-1, 1, 40, 80)
- # Q_5 = Q[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # h_m_5 = h_m[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # T_d_5 = T_d[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # w_e_5 = w_e[:, :, 4, :, :].reshape(-1, 1, 40, 80)
-
- # data_4_5 = u_d4_5 * (dT_dx_d4_5)
- # out_4_5 = model(data_4_5)
-
- # dT_dt_4_5 = Q_5 / (1025 * 4000 * h_m_5) + v_d4_5 * (dT_dy_d4_5) + out_4_5 + w_e_5 * ((T_m_d4_5 - T_d_5) / h_m_5)
-
- # #深度4,天数6
- # T_m_d4_6 = T_m[:, 4, 5, :, :].reshape(-1, 1, 40, 80)
- # u_d4_6 = u[:, 4, 5, :, :].reshape(-1, 1, 40, 80)
- # v_d4_6 = v[:, 4, 5, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d4_6 = dT_dx[:, 4, 5, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d4_6 = dT_dy[:, 4, 5, :, :].reshape(-1, 1, 40, 80)
- # Q_6 = Q[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # h_m_6 = h_m[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # T_d_6 = T_d[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # w_e_6 = w_e[:, :, 5, :, :].reshape(-1, 1, 40, 80)
-
- # data_4_6 = u_d4_6 * (dT_dx_d4_6)
- # out_4_6 = model(data_4_6)
-
- # dT_dt_4_6 = Q_6 / (1025 * 4000 * h_m_6) + v_d4_6 * (dT_dy_d4_6) + out_4_6 + w_e_6 * ((T_m_d4_6 - T_d_6) / h_m_6)
-
- # #深度4,天数7
- # T_m_d4_7 = T_m[:, 4, 6, :, :].reshape(-1, 1, 40, 80)
- # u_d4_7 = u[:, 4, 6, :, :].reshape(-1, 1, 40, 80)
- # v_d4_7 = v[:, 4, 6, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d4_7 = dT_dx[:, 4, 6, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d4_7 = dT_dy[:, 4, 6, :, :].reshape(-1, 1, 40, 80)
- # Q_7 = Q[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # h_m_7 = h_m[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # T_d_7 = T_d[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # w_e_7 = w_e[:, :, 6, :, :].reshape(-1, 1, 40, 80)
-
- # data_4_7 = u_d4_7 * (dT_dx_d4_7)
- # out_4_7 = model(data_4_7)
-
- # dT_dt_4_7 = Q_7 / (1025 * 4000 * h_m_7) + v_d4_7 * (dT_dy_d4_7) + out_4_7 + w_e_7 * ((T_m_d4_7 - T_d_7) / h_m_7)
-
- # #深度5,天数1
- # T_m_d5_1 = T_m[:, 5, 0, :, :].reshape(-1, 1, 40, 80)
- # u_d5_1 = u[:, 5, 0, :, :].reshape(-1, 1, 40, 80)
- # v_d5_1 = v[:, 5, 0, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d5_1 = dT_dx[:, 5, 0, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d5_1 = dT_dy[:, 5, 0, :, :].reshape(-1, 1, 40, 80)
- # Q_1 = Q[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # h_m_1 = h_m[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # T_d_1 = T_d[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # w_e_1 = w_e[:, :, 0, :, :].reshape(-1, 1, 40, 80)
-
- # data_5_1 = u_d5_1 * (dT_dx_d5_1)
- # out_5_1 = model(data_5_1)
-
- # dT_dt_5_1 = Q_1 / (1025 * 4000 * h_m_1) + v_d5_1 * (dT_dy_d5_1) + out_5_1 + w_e_1 * ((T_m_d5_1 - T_d_1) / h_m_1)
-
- # #深度5,天数2
- # T_m_d5_2 = T_m[:, 5, 1, :, :].reshape(-1, 1, 40, 80)
- # u_d5_2 = u[:, 5, 1, :, :].reshape(-1, 1, 40, 80)
- # v_d5_2 = v[:, 5, 1, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d5_2 = dT_dx[:, 5, 1, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d5_2 = dT_dy[:, 5, 1, :, :].reshape(-1, 1, 40, 80)
- # Q_2 = Q[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # h_m_2 = h_m[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # T_d_2 = T_d[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # w_e_2 = w_e[:, :, 1, :, :].reshape(-1, 1, 40, 80)
-
- # data_5_2 = u_d5_2 * (dT_dx_d5_2)
- # out_5_2 = model(data_5_2)
-
- # dT_dt_5_2 = Q_2 / (1025 * 4000 * h_m_2) + v_d5_2 * (dT_dy_d5_2) + out_5_2 + w_e_2 * ((T_m_d5_2 - T_d_2) / h_m_2)
-
- # #深度5,天数3
- # T_m_d5_3 = T_m[:, 5, 2, :, :].reshape(-1, 1, 40, 80)
- # u_d5_3 = u[:, 5, 2, :, :].reshape(-1, 1, 40, 80)
- # v_d5_3 = v[:, 5, 2, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d5_3 = dT_dx[:, 5, 2, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d5_3 = dT_dy[:, 5, 2, :, :].reshape(-1, 1, 40, 80)
- # Q_3 = Q[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # h_m_3 = h_m[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # T_d_3 = T_d[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # w_e_3 = w_e[:, :, 2, :, :].reshape(-1, 1, 40, 80)
-
- # data_5_3 = u_d5_3 * (dT_dx_d5_3)
- # out_5_3 = model(data_5_3)
-
- # dT_dt_5_3 = Q_3 / (1025 * 4000 * h_m_3) + v_d5_3 * (dT_dy_d5_3) + out_5_3 + w_e_3 * ((T_m_d5_3 - T_d_3) / h_m_3)
-
- # #深度5,天数4
- # T_m_d5_4 = T_m[:, 5, 3, :, :].reshape(-1, 1, 40, 80)
- # u_d5_4 = u[:, 5, 3, :, :].reshape(-1, 1, 40, 80)
- # v_d5_4 = v[:, 5, 3, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d5_4 = dT_dx[:, 5, 3, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d5_4 = dT_dy[:, 5, 3, :, :].reshape(-1, 1, 40, 80)
- # Q_4 = Q[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # h_m_4 = h_m[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # T_d_4 = T_d[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # w_e_4 = w_e[:, :, 3, :, :].reshape(-1, 1, 40, 80)
-
- # data_5_4 = u_d5_4 * (dT_dx_d5_4)
- # out_5_4 = model(data_5_4)
-
- # dT_dt_5_4 = Q_4 / (1025 * 4000 * h_m_4) + v_d5_4 * (dT_dy_d5_4) + out_5_4 + w_e_4 * ((T_m_d5_4 - T_d_4) / h_m_4)
-
- # #深度5,天数5
- # T_m_d5_5 = T_m[:, 5, 4, :, :].reshape(-1, 1, 40, 80)
- # u_d5_5 = u[:, 5, 4, :, :].reshape(-1, 1, 40, 80)
- # v_d5_5 = v[:, 5, 4, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d5_5 = dT_dx[:, 5, 4, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d5_5 = dT_dy[:, 5, 4, :, :].reshape(-1, 1, 40, 80)
- # Q_5 = Q[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # h_m_5 = h_m[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # T_d_5 = T_d[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # w_e_5 = w_e[:, :, 4, :, :].reshape(-1, 1, 40, 80)
-
- # data_5_5 = u_d5_5 * (dT_dx_d5_5)
- # out_5_5 = model(data_5_5)
-
- # dT_dt_5_5 = Q_5 / (1025 * 4000 * h_m_5) + v_d5_5 * (dT_dy_d5_5) + out_5_5 + w_e_5 * ((T_m_d5_5 - T_d_5) / h_m_5)
-
- # #深度5,天数6
- # T_m_d5_6 = T_m[:, 5, 5, :, :].reshape(-1, 1, 40, 80)
- # u_d5_6 = u[:, 5, 5, :, :].reshape(-1, 1, 40, 80)
- # v_d5_6 = v[:, 5, 5, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d5_6 = dT_dx[:, 5, 5, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d5_6 = dT_dy[:, 5, 5, :, :].reshape(-1, 1, 40, 80)
- # Q_6 = Q[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # h_m_6 = h_m[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # T_d_6 = T_d[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # w_e_6 = w_e[:, :, 5, :, :].reshape(-1, 1, 40, 80)
-
- # data_5_6 = u_d5_6 * (dT_dx_d5_6)
- # out_5_6 = model(data_5_6)
-
- # dT_dt_5_6 = Q_6 / (1025 * 4000 * h_m_6) + v_d5_6 * (dT_dy_d5_6) + out_5_6 + w_e_6 * ((T_m_d5_6 - T_d_6) / h_m_6)
-
- # #深度5,天数7
- # T_m_d5_7 = T_m[:, 5, 6, :, :].reshape(-1, 1, 40, 80)
- # u_d5_7 = u[:, 5, 6, :, :].reshape(-1, 1, 40, 80)
- # v_d5_7 = v[:, 5, 6, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d5_7 = dT_dx[:, 5, 6, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d5_7 = dT_dy[:, 5, 6, :, :].reshape(-1, 1, 40, 80)
- # Q_7 = Q[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # h_m_7 = h_m[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # T_d_7 = T_d[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # w_e_7 = w_e[:, :, 6, :, :].reshape(-1, 1, 40, 80)
-
- # data_5_7 = u_d5_7 * (dT_dx_d5_7)
- # out_5_7 = model(data_5_7)
-
- # dT_dt_5_7 = Q_7 / (1025 * 4000 * h_m_7) + v_d5_7 * (dT_dy_d5_7) + out_5_7 + w_e_7 * ((T_m_d5_7 - T_d_7) / h_m_7)
-
- # #深度6,天数1
- # T_m_d6_1 = T_m[:, 6, 0, :, :].reshape(-1, 1, 40, 80)
- # u_d6_1 = u[:, 6, 0, :, :].reshape(-1, 1, 40, 80)
- # v_d6_1 = v[:, 6, 0, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d6_1 = dT_dx[:, 6, 0, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d6_1 = dT_dy[:, 6, 0, :, :].reshape(-1, 1, 40, 80)
- # Q_1 = Q[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # h_m_1 = h_m[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # T_d_1 = T_d[:, :, 0, :, :].reshape(-1, 1, 40, 80)
- # w_e_1 = w_e[:, :, 0, :, :].reshape(-1, 1, 40, 80)
-
- # data_6_1 = u_d6_1 * (dT_dx_d6_1)
- # out_6_1 = model(data_6_1)
-
- # dT_dt_6_1 = Q_1 / (1025 * 4000 * h_m_1) + v_d6_1 * (dT_dy_d6_1) + out_6_1 + w_e_1 * ((T_m_d6_1 - T_d_1) / h_m_1)
-
- # #深度6,天数2
- # T_m_d6_2 = T_m[:, 6, 1, :, :].reshape(-1, 1, 40, 80)
- # u_d6_2 = u[:, 6, 1, :, :].reshape(-1, 1, 40, 80)
- # v_d6_2 = v[:, 6, 1, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d6_2 = dT_dx[:, 6, 1, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d6_2 = dT_dy[:, 6, 1, :, :].reshape(-1, 1, 40, 80)
- # Q_2 = Q[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # h_m_2 = h_m[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # T_d_2 = T_d[:, :, 1, :, :].reshape(-1, 1, 40, 80)
- # w_e_2 = w_e[:, :, 1, :, :].reshape(-1, 1, 40, 80)
-
- # data_6_2 = u_d6_2 * (dT_dx_d6_2)
- # out_6_2 = model(data_6_2)
-
- # dT_dt_6_2 = Q_2 / (1025 * 4000 * h_m_2) + v_d6_2 * (dT_dy_d6_2) + out_6_2 + w_e_2 * ((T_m_d6_2 - T_d_2) / h_m_2)
-
- # #深度6,天数3
- # T_m_d6_3 = T_m[:, 6, 2, :, :].reshape(-1, 1, 40, 80)
- # u_d6_3 = u[:, 6, 2, :, :].reshape(-1, 1, 40, 80)
- # v_d6_3 = v[:, 6, 2, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d6_3 = dT_dx[:, 6, 2, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d6_3 = dT_dy[:, 6, 2, :, :].reshape(-1, 1, 40, 80)
- # Q_3 = Q[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # h_m_3 = h_m[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # T_d_3 = T_d[:, :, 2, :, :].reshape(-1, 1, 40, 80)
- # w_e_3 = w_e[:, :, 2, :, :].reshape(-1, 1, 40, 80)
-
- # data_6_3 = u_d6_3 * (dT_dx_d6_3)
- # out_6_3 = model(data_6_3)
-
- # dT_dt_6_3 = Q_3 / (1025 * 4000 * h_m_3) + v_d6_3 * (dT_dy_d6_3) + out_6_3 + w_e_3 * ((T_m_d6_3 - T_d_3) / h_m_3)
-
- # #深度6,天数4
- # T_m_d6_4 = T_m[:, 6, 3, :, :].reshape(-1, 1, 40, 80)
- # u_d6_4 = u[:, 6, 3, :, :].reshape(-1, 1, 40, 80)
- # v_d6_4 = v[:, 6, 3, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d6_4 = dT_dx[:, 6, 3, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d6_4 = dT_dy[:, 6, 3, :, :].reshape(-1, 1, 40, 80)
- # Q_4 = Q[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # h_m_4 = h_m[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # T_d_4 = T_d[:, :, 3, :, :].reshape(-1, 1, 40, 80)
- # w_e_4 = w_e[:, :, 3, :, :].reshape(-1, 1, 40, 80)
-
- # data_6_4 = u_d6_4 * (dT_dx_d6_4)
- # out_6_4 = model(data_6_4)
-
- # dT_dt_6_4 = Q_4 / (1025 * 4000 * h_m_4) + v_d6_4 * (dT_dy_d6_4) + out_6_4 + w_e_4 * ((T_m_d6_4 - T_d_4) / h_m_4)
-
- # #深度6,天数5
- # T_m_d6_5 = T_m[:, 6, 4, :, :].reshape(-1, 1, 40, 80)
- # u_d6_5 = u[:, 6, 4, :, :].reshape(-1, 1, 40, 80)
- # v_d6_5 = v[:, 6, 4, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d6_5 = dT_dx[:, 6, 4, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d6_5 = dT_dy[:, 6, 4, :, :].reshape(-1, 1, 40, 80)
- # Q_5 = Q[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # h_m_5 = h_m[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # T_d_5 = T_d[:, :, 4, :, :].reshape(-1, 1, 40, 80)
- # w_e_5 = w_e[:, :, 4, :, :].reshape(-1, 1, 40, 80)
-
- # data_6_5 = u_d6_5 * (dT_dx_d6_5)
- # out_6_5 = model(data_6_5)
-
- # dT_dt_6_5 = Q_5 / (1025 * 4000 * h_m_5) + v_d6_5 * (dT_dy_d6_5) + out_6_5 + w_e_5 * ((T_m_d6_5 - T_d_5) / h_m_5)
-
- # #深度6,天数6
- # T_m_d6_6 = T_m[:, 6, 5, :, :].reshape(-1, 1, 40, 80)
- # u_d6_6 = u[:, 6, 5, :, :].reshape(-1, 1, 40, 80)
- # v_d6_6 = v[:, 6, 5, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d6_6 = dT_dx[:, 6, 5, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d6_6 = dT_dy[:, 6, 5, :, :].reshape(-1, 1, 40, 80)
- # Q_6 = Q[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # h_m_6 = h_m[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # T_d_6 = T_d[:, :, 5, :, :].reshape(-1, 1, 40, 80)
- # w_e_6 = w_e[:, :, 5, :, :].reshape(-1, 1, 40, 80)
-
- # data_6_6 = u_d6_6 * (dT_dx_d6_6)
- # out_6_6 = model(data_6_6)
-
- # dT_dt_6_6 = Q_6 / (1025 * 4000 * h_m_6) + v_d6_6 * (dT_dy_d6_6) + out_6_6 + w_e_6 * ((T_m_d6_6 - T_d_6) / h_m_6)
-
- # #深度6,天数7
- # T_m_d6_7 = T_m[:, 6, 6, :, :].reshape(-1, 1, 40, 80)
- # u_d6_7 = u[:, 6, 6, :, :].reshape(-1, 1, 40, 80)
- # v_d6_7 = v[:, 6, 6, :, :].reshape(-1, 1, 40, 80);
- # dT_dx_d6_7 = dT_dx[:, 6, 6, :, :].reshape(-1, 1, 40, 80)
- # dT_dy_d6_7 = dT_dy[:, 6, 6, :, :].reshape(-1, 1, 40, 80)
- # Q_7 = Q[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # h_m_7 = h_m[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # T_d_7 = T_d[:, :, 6, :, :].reshape(-1, 1, 40, 80)
- # w_e_7 = w_e[:, :, 6, :, :].reshape(-1, 1, 40, 80)
-
- # data_6_7 = u_d6_7 * (dT_dx_d6_7)
- # out_6_7 = model(data_6_7)
-
- # dT_dt_6_7 = Q_7 / (1025 * 4000 * h_m_7) + v_d6_7 * (dT_dy_d6_7) + out_6_7 + w_e_7 * ((T_m_d6_7 - T_d_7) / h_m_7)
-
- # # # 表面
- # # dT_dt_0_1 = list1[0]; dT_dt_0_2 = list1[1]; dT_dt_0_3 = list1[2]; dT_dt_0_4 = list1[3]; dT_dt_0_5 = list1[4]; dT_dt_0_6 = list1[5]; dT_dt_0_7 = list1[6]
-
- # # # layer1
- # # dT_dt_1_1 = list1[7]; dT_dt_1_2 = list1[8]; dT_dt_1_3 = list1[9]; dT_dt_1_4 = list1[10]; dT_dt_1_5 = list1[11]; dT_dt_1_6 = list1[12]; dT_dt_1_7 = list1[13]
-
- # # # layer2
- # # dT_dt_2_1 = list1[14]; dT_dt_2_2 = list1[15]; dT_dt_2_3 = list1[16]; dT_dt_2_4 = list1[17]; dT_dt_2_5 = list1[18]; dT_dt_2_6 = list1[19]; dT_dt_2_7 = list1[20]
-
- # # # layer3
- # # dT_dt_3_1 = list1[21]; dT_dt_3_2 = list1[22]; dT_dt_3_3 = list1[23]; dT_dt_3_4 = list1[24]; dT_dt_3_5 = list1[25]; dT_dt_3_6 = list1[26]; dT_dt_3_7 = list1[27]
-
- # # # layer4
- # # dT_dt_4_1 = list1[28]; dT_dt_4_2 = list1[29]; dT_dt_4_3 = list1[30]; dT_dt_4_4 = list1[31]; dT_dt_4_5 = list1[32]; dT_dt_4_6 = list1[33]; dT_dt_4_7 = list1[34]
-
- # # # layer5
- # # dT_dt_5_1 = list1[35]; dT_dt_5_2 = list1[36]; dT_dt_5_3 = list1[37]; dT_dt_5_4 = list1[38]; dT_dt_5_5 = list1[39]; dT_dt_5_6 = list1[40]; dT_dt_5_7 = list1[41]
-
- # # # layer5
- # # dT_dt_6_1 = list1[42]; T_dt_6_2 = list1[43]; dT_dt_6_3 = list1[44]; dT_dt_6_4 = list1[45]; dT_dt_6_5 = list1[46]; dT_dt_6_6 = list1[47]; dT_dt_6_7 = list1[48]
-
- # alpha = 0.1
- # beta = 0.9
- # T_8_0 = alpha * (alpha * (alpha * (alpha * (alpha * (alpha * dT_dt_0_1 + beta * dT_dt_0_2) + beta * dT_dt_0_3) + beta * dT_dt_0_4) + beta * dT_dt_0_5) + beta * dT_dt_0_6) + beta * dT_dt_0_7 + T_m[:, 0,6,:,:].reshape( -1, 1, 40, 80)
- # # print('T_8_0_test.shape:{}'.format(T_8_0.shape)) # T_8_0_test.shape:torch.Size([29, 1, 40, 80])
-
- # T_8_1 = alpha * (alpha * (alpha * (alpha * (alpha * (alpha * dT_dt_1_1 + beta * dT_dt_1_2) + beta * dT_dt_1_3) + beta * dT_dt_1_4) + beta * dT_dt_1_5) + beta * dT_dt_1_6) + beta * dT_dt_1_7 + T_m[:,1,6,:,:].reshape(-1, 1, 40, 80)
- # T_8_2 = alpha * (alpha * (alpha * (alpha * (alpha * (alpha * dT_dt_2_1 + beta * dT_dt_2_2) + beta * dT_dt_2_3) + beta * dT_dt_2_4) + beta * dT_dt_2_5) + beta * dT_dt_2_6) + beta * dT_dt_2_7 + T_m[:,2,6,:,:].reshape(-1, 1, 40, 80)
- # T_8_3 = alpha * (alpha * (alpha * (alpha * (alpha * (alpha * dT_dt_3_1 + beta * dT_dt_3_2) + beta * dT_dt_3_3) + beta * dT_dt_3_4) + beta * dT_dt_3_5) + beta * dT_dt_3_6) + beta * dT_dt_3_7 + T_m[:,3,6,:,:].reshape(-1, 1, 40, 80)
- # T_8_4 = alpha * (alpha * (alpha * (alpha * (alpha * (alpha * dT_dt_4_1 + beta * dT_dt_4_2) + beta * dT_dt_4_3) + beta * dT_dt_4_4) + beta * dT_dt_4_5) + beta * dT_dt_4_6) + beta * dT_dt_4_7 + T_m[:,4,6,:,:].reshape(-1, 1, 40, 80)
- # T_8_5 = alpha * (alpha * (alpha * (alpha * (alpha * (alpha * dT_dt_5_1 + beta * dT_dt_5_2) + beta * dT_dt_5_3) + beta * dT_dt_5_4) + beta * dT_dt_5_5) + beta * dT_dt_5_6) + beta * dT_dt_5_7 + T_m[:,5,6,:,:].reshape(-1, 1, 40, 80)
- # T_8_6 = alpha * (alpha * (alpha * (alpha * (alpha * (alpha * dT_dt_6_1 + beta * dT_dt_6_2) + beta * dT_dt_6_3) + beta * dT_dt_6_4) + beta * dT_dt_6_5) + beta * dT_dt_6_6) + beta * dT_dt_6_7 + T_m[:,6,6,:,:].reshape(-1, 1, 40, 80)
-
- # T_8_all = torch.cat((T_8_0, T_8_1, T_8_2, T_8_3, T_8_4, T_8_4, T_8_6), dim=1)
- # # print('T_8_all.shape:{}'.format(T_8_all.shape)) # T_8_0.shape:torch.Size([32, 1, 40, 80])
-
- # label_8 = label[:, :, 0, :, :]
- # # print('label_8.shape:{}'.format(label_8.shape)) # label.shape:torch.Size([32, 7, 10, 40, 80])
-
- # loss = criterion(T_8_all, label_8)
- # losses += float(loss)
- # T_8_all = T_8_all.detach().cpu().numpy()
-
- # pred_val[d * batch_size2:(d + 1) * batch_size2] = np.array(T_8_all)
-
- # valid_loss = losses / len(validloader)
- # valid_losses.append(valid_loss)
- # print('valid_label.shape:{}'.format(valid_label0.shape))
- # print('pred_val.shape:{}'.format(pred_val.shape))
- # valid_label = valid_label0.reshape(-1, 1)
- # T_8_all = pred_val.reshape(-1,1)
-
- # s = rmse(valid_label, T_8_all)
- # sores.append(s)
- # print('Score:{:.3f}'.format(s))
-
- # if valid_loss < best_score2: # 求s的最小值 ---》最大值反过来 inf符号也要反过来
- # best_score2 = valid_loss
- # checkpoint = {'best_score': valid_loss,
- # 'state_dict': model.state_dict()}
- # torch.save(checkpoint, model_weights1) # if valid_loss < best_loss:
- # best_loss = valid_loss
- # torch.save(model.state_dict(),
- # '/model/cnn_PINN_f(2)_e{}_layer3_ahead_8_day_e{}.pt'.format(epoch111,iii))
- # # print(s)
- # # print(s)
- # print(sores)
- # print(best_score)
- # print(s)
|