openclimatefix / power_perceiver

Machine learning experiments using the Perceiver IO model to forecast the electricity system (starting with solar)
MIT License
7 stars 1 forks source link

Implement `np_batch_processor.EncodeSpaceTime` #31

Closed JackKelly closed 2 years ago

JackKelly commented 2 years ago

Use the code I wrote in December as a start. Planning to use relative position encoding (because the most important function of absolute position is the Sun's position; and we'll give the Sun's position explicitly in the query).

patch the imagery first. See issue #32.

Implementation ideas:

PATCH_SIZE = 4
dataset = NowcastingDataset(
    data_loaders=[
        PV(),
        HRVSatellite(
            transforms=PatchSatellite(x=PATCH_SIZE, y=PATCH_SIZE)  # uses DataArrayCoarsen.construct
        ),
    ],
    xr_batch_processors=[
        SelectPVSystemsNearCenterOfImage(),
    ],
    np_batch_processors=[
        EncodeSpaceTime(),
    ],
)