PVNet 5.0.20__tar.gz → 5.0.21__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. {pvnet-5.0.20 → pvnet-5.0.21}/PKG-INFO +1 -1
  2. {pvnet-5.0.20 → pvnet-5.0.21}/PVNet.egg-info/PKG-INFO +1 -1
  3. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/models/late_fusion/encoders/encoders3d.py +22 -10
  4. {pvnet-5.0.20 → pvnet-5.0.21}/LICENSE +0 -0
  5. {pvnet-5.0.20 → pvnet-5.0.21}/PVNet.egg-info/SOURCES.txt +0 -0
  6. {pvnet-5.0.20 → pvnet-5.0.21}/PVNet.egg-info/dependency_links.txt +0 -0
  7. {pvnet-5.0.20 → pvnet-5.0.21}/PVNet.egg-info/requires.txt +0 -0
  8. {pvnet-5.0.20 → pvnet-5.0.21}/PVNet.egg-info/top_level.txt +0 -0
  9. {pvnet-5.0.20 → pvnet-5.0.21}/README.md +0 -0
  10. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/__init__.py +0 -0
  11. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/data/__init__.py +0 -0
  12. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/data/base_datamodule.py +0 -0
  13. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/data/site_datamodule.py +0 -0
  14. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/data/uk_regional_datamodule.py +0 -0
  15. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/load_model.py +0 -0
  16. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/models/__init__.py +0 -0
  17. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/models/base_model.py +0 -0
  18. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/models/ensemble.py +0 -0
  19. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/models/late_fusion/__init__.py +0 -0
  20. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/models/late_fusion/basic_blocks.py +0 -0
  21. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/models/late_fusion/encoders/__init__.py +0 -0
  22. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/models/late_fusion/encoders/basic_blocks.py +0 -0
  23. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/models/late_fusion/late_fusion.py +0 -0
  24. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/models/late_fusion/linear_networks/__init__.py +0 -0
  25. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/models/late_fusion/linear_networks/basic_blocks.py +0 -0
  26. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/models/late_fusion/linear_networks/networks.py +0 -0
  27. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/models/late_fusion/site_encoders/__init__.py +0 -0
  28. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/models/late_fusion/site_encoders/basic_blocks.py +0 -0
  29. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/models/late_fusion/site_encoders/encoders.py +0 -0
  30. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/optimizers.py +0 -0
  31. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/training/__init__.py +0 -0
  32. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/training/lightning_module.py +0 -0
  33. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/training/plots.py +0 -0
  34. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/training/train.py +0 -0
  35. {pvnet-5.0.20 → pvnet-5.0.21}/pvnet/utils.py +0 -0
  36. {pvnet-5.0.20 → pvnet-5.0.21}/pyproject.toml +0 -0
  37. {pvnet-5.0.20 → pvnet-5.0.21}/setup.cfg +0 -0
  38. {pvnet-5.0.20 → pvnet-5.0.21}/tests/test_end2end.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PVNet
3
- Version: 5.0.20
3
+ Version: 5.0.21
4
4
  Summary: PVNet
5
5
  Author-email: Peter Dudfield <info@openclimatefix.org>
6
6
  Requires-Python: >=3.11
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PVNet
3
- Version: 5.0.20
3
+ Version: 5.0.21
4
4
  Summary: PVNet
5
5
  Author-email: Peter Dudfield <info@openclimatefix.org>
6
6
  Requires-Python: >=3.11
@@ -25,6 +25,7 @@ class DefaultPVNet(AbstractNWPSatelliteEncoder):
25
25
  spatial_kernel_size: int = 3,
26
26
  temporal_kernel_size: int = 3,
27
27
  padding: int | tuple[int, ...] = (1, 0, 0),
28
+ stride: int | tuple[int, ...] = 1,
28
29
  ):
29
30
  """This is the original encoding module used in PVNet, with a few minor tweaks.
30
31
 
@@ -39,29 +40,38 @@ class DefaultPVNet(AbstractNWPSatelliteEncoder):
39
40
  spatial_kernel_size: The spatial size of the kernel used in the conv3d layers.
40
41
  temporal_kernel_size: The temporal size of the kernel used in the conv3d layers.
41
42
  padding: The padding used in the conv3d layers. If an int, the same padding
42
- is used in all dimensions
43
+ is used in all dimensions. The dimensions are (time, space, space)
44
+ stride: The stride used in conv3d layers. If an int, the same stride is used
45
+ in all dimensions
43
46
  """
44
47
 
45
48
  super().__init__(sequence_length, image_size_pixels, in_channels, out_features)
46
49
 
47
50
  if isinstance(padding, int):
48
51
  padding = (padding, padding, padding)
52
+
53
+ if isinstance(stride, int):
54
+ stride = (stride, stride, stride)
49
55
 
50
56
  # Check that the output shape of the convolutional layers will be at least 1x1
51
- cnn_spatial_output_size = (
52
- image_size_pixels
53
- - ((spatial_kernel_size - 2 * padding[1]) - 1) * number_of_conv3d_layers
54
- )
55
- cnn_sequence_length = (
56
- sequence_length
57
- - ((temporal_kernel_size - 2 * padding[0]) - 1) * number_of_conv3d_layers
58
- )
57
+ cnn_spatial_output_size = image_size_pixels
58
+
59
+ for _ in range(number_of_conv3d_layers):
60
+ cnn_spatial_output_size = (
61
+ cnn_spatial_output_size - spatial_kernel_size + 2 * padding[1]
62
+ ) // stride[1] + 1
63
+
59
64
  if not (cnn_spatial_output_size >= 1):
60
65
  raise ValueError(
61
66
  f"cannot use this many conv3d layers ({number_of_conv3d_layers}) with this input "
62
67
  f"spatial size ({image_size_pixels})"
63
68
  )
64
69
 
70
+ cnn_sequence_length = (
71
+ sequence_length
72
+ - ((temporal_kernel_size - 2 * padding[0]) - 1) * number_of_conv3d_layers
73
+ )
74
+
65
75
  conv_layers = []
66
76
 
67
77
  conv_layers += [
@@ -70,16 +80,18 @@ class DefaultPVNet(AbstractNWPSatelliteEncoder):
70
80
  out_channels=conv3d_channels,
71
81
  kernel_size=(temporal_kernel_size, spatial_kernel_size, spatial_kernel_size),
72
82
  padding=padding,
83
+ stride=stride,
73
84
  ),
74
85
  nn.ELU(),
75
86
  ]
76
- for i in range(0, number_of_conv3d_layers - 1):
87
+ for _ in range(0, number_of_conv3d_layers - 1):
77
88
  conv_layers += [
78
89
  nn.Conv3d(
79
90
  in_channels=conv3d_channels,
80
91
  out_channels=conv3d_channels,
81
92
  kernel_size=(temporal_kernel_size, spatial_kernel_size, spatial_kernel_size),
82
93
  padding=padding,
94
+ stride=stride,
83
95
  ),
84
96
  nn.ELU(),
85
97
  ]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes