mirror of
https://github.com/wassname/pytorch-ts.git
synced 2026-07-19 11:27:25 +08:00
formatting
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
# First-party imports
|
||||
from pts.dataset import FieldName
|
||||
|
||||
|
||||
def test_dataset_fields():
|
||||
assert (
|
||||
"feat_static_cat" == FieldName.FEAT_STATIC_CAT
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
# permissions and limitations under the License.
|
||||
|
||||
import numpy as np
|
||||
|
||||
# Standard library imports
|
||||
import pytest
|
||||
|
||||
@@ -116,8 +117,7 @@ def test_multivariate_grouper_test(
|
||||
univariate_ts, multivariate_ts, test_fill_rule, max_target_dim
|
||||
) -> None:
|
||||
univariate_ds = ListDataset(univariate_ts, freq="1D")
|
||||
multivariate_ds = ListDataset(
|
||||
multivariate_ts, freq="1D", one_dim_target=False)
|
||||
multivariate_ds = ListDataset(multivariate_ts, freq="1D", one_dim_target=False)
|
||||
|
||||
grouper = MultivariateGrouper(
|
||||
test_fill_rule=test_fill_rule, num_test_dates=2, max_target_dim=max_target_dim,
|
||||
|
||||
@@ -46,28 +46,13 @@ metadata = dataset.metadata
|
||||
estimator = DeepVAREstimator
|
||||
|
||||
|
||||
#@pytest.mark.timeout(10)
|
||||
# @pytest.mark.timeout(10)
|
||||
@pytest.mark.parametrize(
|
||||
"distr_output, num_batches_per_epoch, Estimator, use_marginal_transformation",
|
||||
[
|
||||
(
|
||||
NormalOutput(dim=target_dim),
|
||||
10,
|
||||
estimator,
|
||||
True,
|
||||
),
|
||||
(
|
||||
NormalOutput(dim=target_dim),
|
||||
10,
|
||||
estimator,
|
||||
False,
|
||||
),
|
||||
(
|
||||
LowRankMultivariateNormalOutput(dim=target_dim, rank=2),
|
||||
10,
|
||||
estimator,
|
||||
True,
|
||||
),
|
||||
(NormalOutput(dim=target_dim), 10, estimator, True,),
|
||||
(NormalOutput(dim=target_dim), 10, estimator, False,),
|
||||
(LowRankMultivariateNormalOutput(dim=target_dim, rank=2), 10, estimator, True,),
|
||||
(
|
||||
LowRankMultivariateNormalOutput(dim=target_dim, rank=2),
|
||||
10,
|
||||
@@ -75,18 +60,8 @@ estimator = DeepVAREstimator
|
||||
False,
|
||||
),
|
||||
(None, 10, estimator, True),
|
||||
(
|
||||
MultivariateNormalOutput(dim=target_dim),
|
||||
10,
|
||||
estimator,
|
||||
True,
|
||||
),
|
||||
(
|
||||
MultivariateNormalOutput(dim=target_dim),
|
||||
10,
|
||||
estimator,
|
||||
False,
|
||||
),
|
||||
(MultivariateNormalOutput(dim=target_dim), 10, estimator, True,),
|
||||
(MultivariateNormalOutput(dim=target_dim), 10, estimator, False,),
|
||||
],
|
||||
)
|
||||
def test_deepvar(
|
||||
|
||||
@@ -190,7 +190,7 @@ def test_independent_normal() -> None:
|
||||
|
||||
loc = np.arange(0, dim) / float(dim)
|
||||
diag = np.arange(dim) / dim + 0.5
|
||||
Sigma = diag**2
|
||||
Sigma = diag ** 2
|
||||
|
||||
distr = Independent(Normal(loc=torch.Tensor(loc), scale=torch.Tensor(diag)), 1)
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import pytest
|
||||
import torch
|
||||
|
||||
from pts import transform
|
||||
|
||||
# First-party imports
|
||||
from pts.dataset import (
|
||||
ProcessStartField,
|
||||
|
||||
Reference in New Issue
Block a user