-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
56 lines (45 loc) · 1.44 KB
/
Copy pathtest.py
File metadata and controls
56 lines (45 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import torch
import torch.nn as nn
from torch.nn.modules.pooling import MaxPool2d
from scripts.prepare_data import prepare_permeability, generate_cfs_array_test, ExperimentalDataset
from pathlib import Path
data_path = Path('D:\Work\KT\Iranian_ml\cfs\cfs_normalized')
labels_path = Path('D:\Work\KT\Iranian_ml\perm\\normalized')
data = generate_cfs_array_test(data_path)
labels = prepare_permeability(labels_path)
data = torch.Tensor(data)
labels = torch.Tensor(labels)
test = ExperimentalDataset(data[0:1], labels[0:1])
# print(test[0][0].shape)
# leaky_relu = nn.LeakyReLU()
# conv1 = nn.Conv2d(in_channels=4, out_channels=8, kernel_size=7, padding=3)
# conv2 = nn.Conv2d(in_channels=8, out_channels=12, kernel_size=5, padding=2)
# conv3 = nn.Conv2d(in_channels=12, out_channels=6, kernel_size=3, padding=1)
# conv4 = nn.Conv2d(in_channels=6, out_channels=3, kernel_size=3, padding=1)
# conv5 = nn.Conv2d(in_channels=3, out_channels=1, kernel_size=3, padding=1)
# pool1 = MaxPool2d((4,1), stride=(2,1))
# pool2 = MaxPool2d((10,1), stride=(5,1))
# b = conv1(test[0][0])
# print(b.shape)
# b = leaky_relu(b)
# b = pool1(b)
# print(b.shape)
# b = conv2(b)
# print(b.shape)
# b = leaky_relu(b)
# b = pool1(b)
# print(b.shape)
# b = conv3(b)
# print(b.shape)
# b = leaky_relu(b)
# b = pool1(b)
# print(b.shape)
# b = conv4(b)
# print(b.shape)
# b = leaky_relu(b)
# b = pool1(b)
# b = conv5(b)
# print(b.shape)
# b = leaky_relu(b)
# b = pool2(b)
# print(b.shape)