Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

swh:1:snp:00a09dfe75d92a5d9631593944db4c280ca40ab3
  • Code
  • Branches (1)
  • Releases (0)
    • Branches
    • Releases
    • HEAD
    • refs/heads/main
    No releases to show
  • e84a592
  • /
  • src
  • /
  • datasets
  • /
  • pvc1.py
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
content badge
swh:1:cnt:df62f6bed1a6b2c91070b22d0efde4e14bd176a9
directory badge
swh:1:dir:44dbae8a3602ecf2bce3ca35c8b38bcab0f026c0
revision badge
swh:1:rev:9eccfe575524736f25f4f3759fe04648f22554de
snapshot badge
swh:1:snp:00a09dfe75d92a5d9631593944db4c280ca40ab3

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: 9eccfe575524736f25f4f3759fe04648f22554de authored by Luke Taylor on 09 April 2024, 14:00:54 UTC
Added brainbox version.
Tip revision: 9eccfe5
pvc1.py
from src.datasets.base import BaseDataset
from src.datasets.mineault.pvc1 import PVC1


class PVC1Dataset(BaseDataset):

    def __init__(self, root, split, ntau, idx, repeats=True, normalise=True, scale=1):
        super().__init__(normalise, scale, True)
        split = "traintune" if split == "train" else "report"
        path = f"{root}/data/processed/crcns-pvc1"
        self._pvc1 = PVC1(path,
                          split=split,
                          nt=1,
                          nx=112,
                          ny=112,
                          ntau=ntau,
                          nframedelay=0,
                          repeats=repeats,
                          single_cell=idx,
                          nframestart=ntau)

    def __len__(self):
        return len(self._pvc1)

    def _get_dimensions(self):
        return 112, 112

    def _get_mean_std(self):
        return 0.08094, 1.03749

    def _get_dataset_item(self, i):
        x, _, y, _ = self._pvc1[i]
        return x, y


class SinglePVC1Dataset(PVC1Dataset):

    def __init__(self, root, split, ntau, normalise=True, scale=1):
        super().__init__(root, split, ntau, -1, repeats=False, normalise=normalise, scale=scale)

    def _get_dataset_item(self, i):
        x, _, _, y = self._pvc1[i]
        return x, y[:, 0]


class MultiPVC1Dataset(PVC1Dataset):

    def __init__(self, root, split, ntau, idx, normalise=True, scale=1):
        super().__init__(root, split, ntau, idx, repeats=True, normalise=normalise, scale=scale)

    def _get_dataset_item(self, i):
        x, _, y, _ = self._pvc1[i]
        return x, y[0]

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API