-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
63 lines (53 loc) · 4.37 KB
/
test.py
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
55
56
57
58
59
60
61
62
63
# import torch
# import torchvision.models as models
# # Load the ResNet18 model
# pretrained_model = models.resnet18(weights='DEFAULT')
# # Remove the last two layers
# backbone = torch.nn.Sequential(*list(pretrained_model.children())[:-2])
# # Create a sample input tensor with the shape (batch_size, channels, height, width)
# sample_input = torch.randn(1, 3, 1280, 640)
# # Pass the sample input through the modified model
# output = backbone(sample_input)
# # Print the output shape
# print(output.shape)
import matplotlib.pyplot as plt
import numpy as np
import torch
# data = torch.tensor(
# [1.3600, 1.2122, 1.1195, 1.1124, 1.1552, 1.1882, 1.1800, 1.1565, 1.1669,
# 1.2357, 1.3405, 1.4176, 1.4093, 1.3188, 1.1988, 1.0956, 1.0219, 0.9687,
# 0.9271, 0.8989, 0.8918, 0.9064, 0.9293, 0.9396, 0.9269, 0.9019, 0.8843,
# 0.8823, 0.8814, 0.8532, 0.7823, 0.6865, 0.6016, 0.5542, 0.5533, 0.5959,
# 0.6701, 0.7552, 0.8261, 0.8647, 0.8709, 0.8665, 0.8884, 0.9801, 1.1831,
# 1.5122, 1.8903, 2.1174, 2.0398, 1.7565, 1.4938, 1.3838, 1.4391, 1.5880,
# 1.6837, 1.6067, 1.4061, 1.2357, 1.1989, 1.3218, 1.5644, 1.7967, 1.8601,
# 1.7299, 1.5292, 1.3736, 1.2930, 1.2601, 1.2384, 1.2163, 1.2127, 1.2489,
# 1.3202, 1.3883, 1.4063, 1.3676, 1.3172, 1.3094, 1.3676, 1.4733, 1.5759,
# 1.6279, 1.6209, 1.5759, 1.5036, 1.3907, 1.2323, 1.0627, 0.9381, 0.8971,
# 0.9454, 1.0477, 1.1202, 1.0828, 0.9534, 0.8267, 0.7748, 0.8149, 0.9202,
# 1.0218]
# )
# data = torch.tensor(
# [1.0856, 1.0016, 0.9224, 0.9055, 0.9028, 0.9225, 0.9450, 0.9624, 0.9604,
# 0.9515, 0.9581, 1.0069, 1.0843, 1.2104, 1.3450, 1.4832, 1.6273, 1.6463,
# 1.6819, 1.6807, 1.7236, 1.7067, 1.6953, 1.6413, 1.5709, 1.5102, 1.4569,
# 1.4002, 1.3570, 1.2933, 1.2582, 1.2282, 1.2228, 1.2066, 1.2714, 1.2642,
# 1.2312, 1.2026, 1.1884, 1.1323, 1.0896, 1.0400, 1.0023, 1.0049, 0.9934,
# 0.9751, 0.9634, 0.9227, 0.8856, 0.8728, 0.8700, 0.8703, 0.8737, 0.8888,
# 0.9213, 0.9990, 1.0423, 1.1406, 1.1690, 1.1624, 1.1534, 1.1452, 1.1251,
# 1.1189, 1.0977, 1.0982, 1.0974, 1.1032, 1.0855, 1.0582, 1.0388, 1.0199,
# 1.0136, 1.0163, 1.0578, 1.1444, 1.2088, 1.2007, 1.2238, 1.2058, 1.1948,
# 1.2047, 1.2381, 1.2491, 1.2220, 1.1841, 1.1615, 1.1077, 1.0716, 1.0649,
# 1.0596, 1.0927, 1.1334, 1.1799, 1.2464, 1.2994, 1.3040, 1.3560, 1.3775,
# 1.4948]
# )
# data_np = data.numpy()
# plt.plot(data_np, linestyle='-')
# plt.xlabel('Timestep')
# plt.ylabel('Weight')
# plt.title('Example Weight vs. Timestep')
# plt.savefig('example_plot_sqmean_self_normalized_4.png')
# data = [380.46, 308.08, 186.42]
data = [235.58, 408.92, 424.06]
print(np.mean(data))
print(np.std(data))