删除重复数据集

main
get 1 year ago
parent e63e89cf74
commit dfbad8daa2

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="C:\anaconda\envs\pytorch" project-jdk-type="Python SDK" /> <component name="ProjectRootManager" version="2" project-jdk-name="pytorch_gpu" project-jdk-type="Python SDK" />
</project> </project>

@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4"> <module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager"> <component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" /> <content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="C:\anaconda\envs\pytorch" jdkType="Python SDK" /> <orderEntry type="jdk" jdkName="pytorch_gpu" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
</module> </module>

@ -0,0 +1,27 @@
import torch
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from torch import nn
import os
torch.manual_seed(42)
os.environ["KMP_DUPLICATE_LIB_OK"]="TRUE" # 解决OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
class LSTM(nn.Module):
def __init__(self,input_size,hidden_size,output_size,num_layers=2):
super().__init__()
self.lstm = nn.LSTM(input_size,hidden_size,num_layers=2)
self.fc1 = nn.Linear(hidden_size,64)
self.ReLu = nn.ReLU()
self.fc2 = nn.Linear(64,output_size)
def forward(self,x):
output,_ = self.lstm(x)
s,b,h = output.shape
output = output.reshape(-1,h)
output = self.ReLu(self.fc1(output))
output = self.fc2(output)
return output
# 创建数据集
Loading…
Cancel
Save