Skip to content

TSMixup code script #213

Answered by abdulfatir
vincehass asked this question in Q&A
Discussion options

You must be logged in to vote

@vincehass Please use discussions for questions, since this is not a bug.

The TSMixup script is not in this repository because we already released both the raw and tsmixed datasets on HuggingFace.

If you are still looking for a reference implementation, this should be close enough:

from copy import deepcopy
from itertools import islice
from pathlib import Path

import numpy as np
import pandas as pd
from gluonts.dataset.arrow import ArrowWriter
from gluonts.itertools import Cyclic
from tqdm.auto import tqdm


def ts_sampler(datasets):
    infinite_iterators = list(map(lambda d: iter(Cyclic(d)), datasets))
    while True:
        idx = np.random.randint(len(datasets))
        yield next(in…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by abdulfatir
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #212 on November 27, 2024 21:24.