tracebloc 1.2.82__tar.gz → 1.2.83__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.
- {tracebloc-1.2.82 → tracebloc-1.2.83}/PKG-INFO +1 -1
- {tracebloc-1.2.82 → tracebloc-1.2.83}/pyproject.toml +1 -1
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/utils/registry.py +0 -7
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/utils/safetensors_io.py +0 -16
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/utils/time_series_utils.py +0 -72
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc.egg-info/PKG-INFO +1 -1
- {tracebloc-1.2.82 → tracebloc-1.2.83}/MANIFEST.in +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/README.md +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/license.txt +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/setup.cfg +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/__init__.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/_deprecation.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/_framework_utils.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/_http_utils.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/_link_answer.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/_link_regeneration.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/_linking.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/_raw_width_note.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/_stored_link.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/_upload_conversion.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/checks.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/client.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/config.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/contracts/stage_urls.v1.json +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/contracts/stage_urls.v1.source.json +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/contracts/survival_payload.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/contracts/training_requirements.source.json +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/contracts/training_requirements.txt +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/__init__.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/acceptance.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/families/__init__.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/families/hf/__init__.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/families/hf/_build.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/families/hf/_model_type.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/families/tabular.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/families/vision/__init__.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/families/vision/_matching.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/gate.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/heads.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/interfaces.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/licence/__init__.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/licence/spdx.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/outputs.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/owncode/__init__.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/owncode/arguments.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/owncode/assemble.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/owncode/checkpoint.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/owncode/gate_rules.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/owncode/generate.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/owncode/head.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/owncode/import_check.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/owncode/layer0.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/owncode/live.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/owncode/model_class.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/owncode/remote.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/owncode/repo.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/owncode/shake.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/owncode/source_tree.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/package.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/report.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/tokenizers.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/convert/training_versions.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/env_login.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/exceptions.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/fetch.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/inference.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/library_fetch.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/lifelines_weights.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/link_model_dataset.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/notebook/__init__.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/notebook/templates/_partials.tpl +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/notebook/templates/embeddings.tpl +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/notebook/templates/nlp_finetune.tpl +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/notebook/templates/nlp_generative.tpl +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/notebook/templates/survival.tpl +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/notebook/templates/tabular_timeseries.tpl +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/notebook/templates/vision_from_scratch.tpl +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/raw_mode.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/raw_mode_frame.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/raw_mode_seed.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/raw_mode_survival.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/raw_mode_torch.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/seed_weights.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/training/__init__.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/training/augmentation.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/training/callbacks.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/training/converted.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/training/features.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/training/image_channels.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/training/image_size.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/training/lora.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/training/lora_validation.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/training/loss.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/training/memory_estimate.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/training/plan.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/training/preprocessing.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/training/shape.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/training/subdataset.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/training/submitter.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/training/summary.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/__init__.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/lifelines_time_to_event.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/model_upload.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/scikit_survival_time_to_event.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/sequence_length.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/skl_tabular_base.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/skl_tabular_classifier.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/skl_tabular_regression.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/statistical_base.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/survival_base.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/torch_causal_language_modeler.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/torch_embeddings.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/torch_image_classifier.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/torch_key_point_detector.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/torch_masked_language_modeler.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/torch_nlp_base.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/torch_object_detector.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/torch_semantic_segmentation.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/torch_sentence_pair_classifier.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/torch_seq2seq_modeler.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/torch_tabular_classifier.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/torch_tabular_regression.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/torch_text_classifier.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/torch_time_series_classifier.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/torch_time_series_forecaster.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/torch_time_to_event.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/torch_token_classifier.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/weight_loaders.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/upload/weights_parts.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/user.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/utils/__init__.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/utils/class_order.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/utils/constants.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/utils/custom_loss_probe.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/utils/detection_utils.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/utils/entry_point.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/utils/feature_dict.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/utils/general_utils.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/utils/key_point_detection_utils.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/utils/semantic_segmentation_utils.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/utils/tabular_classification_utils.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/utils/tabular_custom_loss_utils.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/utils/tabular_regression_utils.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/utils/text_classification_utils.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/utils/time_to_event_utils.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/utils/warnings_once.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/validation/__init__.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/validation/checker.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/validation/header_rules.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/validation/lifelines_checks.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/validation/pytorch_checks.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/validation/rewriter.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/validation/scikit_survival_checks.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc/validation/sklearn_checks.py +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc.egg-info/SOURCES.txt +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc.egg-info/dependency_links.txt +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc.egg-info/requires.txt +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc.egg-info/top_level.txt +0 -0
- {tracebloc-1.2.82 → tracebloc-1.2.83}/tracebloc_package/__init__.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tracebloc"
|
|
7
|
-
version = "1.2.
|
|
7
|
+
version = "1.2.83"
|
|
8
8
|
description = "Build AI with anyone. On data that can't move. SDK for the tracebloc collaborative AI workspace."
|
|
9
9
|
license = "MIT"
|
|
10
10
|
license-files = ["license.txt"]
|
|
@@ -156,10 +156,3 @@ def get_task_class(task, framework):
|
|
|
156
156
|
_TASK_CLASS_REGISTRY[key] = cls
|
|
157
157
|
return cls
|
|
158
158
|
return entry
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
def _module_to_extra_known_keys():
|
|
162
|
-
"""Return the set of optional-dep module names we map to extras."""
|
|
163
|
-
from tracebloc._framework_utils import _MODULE_TO_EXTRA
|
|
164
|
-
|
|
165
|
-
return set(_MODULE_TO_EXTRA)
|
|
@@ -127,22 +127,6 @@ def read_weights_envelope(path):
|
|
|
127
127
|
return {}
|
|
128
128
|
|
|
129
129
|
|
|
130
|
-
def _index_key(i, total):
|
|
131
|
-
width = max(4, len(str(total - 1))) if total > 0 else 4
|
|
132
|
-
return str(i).zfill(width)
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
def list_to_indexed_dict(arrays):
|
|
136
|
-
"""TF positional ``list[ndarray]`` -> ``{zero-padded-index: ndarray}``."""
|
|
137
|
-
total = len(arrays)
|
|
138
|
-
return {_index_key(i, total): arr for i, arr in enumerate(arrays)}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
def indexed_dict_to_list(tensors):
|
|
142
|
-
"""Inverse of :func:`list_to_indexed_dict`: sort keys numerically -> list."""
|
|
143
|
-
return [tensors[key] for key in sorted(tensors, key=int)]
|
|
144
|
-
|
|
145
|
-
|
|
146
130
|
def save_weights_safetensors(
|
|
147
131
|
tensors, *, framework, layout, producer="sdk", extra_metadata=None
|
|
148
132
|
):
|
|
@@ -8,26 +8,6 @@ from tracebloc.utils.constants import (
|
|
|
8
8
|
)
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
class TimeSeriesDataset(Dataset):
|
|
12
|
-
"""
|
|
13
|
-
Dataset for time series forecasting.
|
|
14
|
-
|
|
15
|
-
Args:
|
|
16
|
-
sequences: Input sequences of shape (num_samples, input_sequence_length, num_features)
|
|
17
|
-
targets: Target values of shape (num_samples, forecast_horizon) or (num_samples, forecast_horizon, num_features)
|
|
18
|
-
"""
|
|
19
|
-
|
|
20
|
-
def __init__(self, sequences, targets):
|
|
21
|
-
self.sequences = sequences.astype(np.float32)
|
|
22
|
-
self.targets = targets.astype(np.float32)
|
|
23
|
-
|
|
24
|
-
def __len__(self):
|
|
25
|
-
return len(self.sequences)
|
|
26
|
-
|
|
27
|
-
def __getitem__(self, idx):
|
|
28
|
-
return torch.tensor(self.sequences[idx]), torch.tensor(self.targets[idx])
|
|
29
|
-
|
|
30
|
-
|
|
31
11
|
class FakeTimeSeriesDataset(Dataset):
|
|
32
12
|
"""
|
|
33
13
|
Generates fake time series data for model validation.
|
|
@@ -112,33 +92,6 @@ class FakeTimeSeriesDataset(Dataset):
|
|
|
112
92
|
return torch.tensor(sequence, dtype=torch.float32), torch.tensor(target, dtype=torch.float32)
|
|
113
93
|
|
|
114
94
|
|
|
115
|
-
def generate_time_series_data(
|
|
116
|
-
num_samples=100,
|
|
117
|
-
sequence_length=TS_DEFAULT_SEQUENCE_LENGTH,
|
|
118
|
-
forecast_horizon=TS_DEFAULT_FORECAST_HORIZON,
|
|
119
|
-
num_features=1,
|
|
120
|
-
):
|
|
121
|
-
"""
|
|
122
|
-
Generate synthetic time series data for training/validation.
|
|
123
|
-
|
|
124
|
-
Args:
|
|
125
|
-
num_samples: Number of samples to generate
|
|
126
|
-
sequence_length: Length of input sequences (lookback window)
|
|
127
|
-
forecast_horizon: Number of steps to forecast
|
|
128
|
-
num_features: Number of features in the time series
|
|
129
|
-
|
|
130
|
-
Returns:
|
|
131
|
-
tuple: (sequences, targets) as numpy arrays
|
|
132
|
-
"""
|
|
133
|
-
dataset = FakeTimeSeriesDataset(
|
|
134
|
-
num_samples=num_samples,
|
|
135
|
-
sequence_length=sequence_length,
|
|
136
|
-
forecast_horizon=forecast_horizon,
|
|
137
|
-
num_features=num_features,
|
|
138
|
-
)
|
|
139
|
-
return dataset.sequences, dataset.targets
|
|
140
|
-
|
|
141
|
-
|
|
142
95
|
def get_time_series_dataloader(
|
|
143
96
|
num_samples=50,
|
|
144
97
|
sequence_length=TS_DEFAULT_SEQUENCE_LENGTH,
|
|
@@ -302,28 +255,3 @@ def get_time_series_classification_dataloader(
|
|
|
302
255
|
num_classes=num_classes,
|
|
303
256
|
)
|
|
304
257
|
return DataLoader(dataset, batch_size=batch_size, shuffle=True)
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
def create_sequences(data, sequence_length, forecast_horizon):
|
|
308
|
-
"""
|
|
309
|
-
Convert a time series array into input-output sequence pairs.
|
|
310
|
-
|
|
311
|
-
Args:
|
|
312
|
-
data: Time series data of shape (total_length, num_features) or (total_length,)
|
|
313
|
-
sequence_length: Length of input sequences (lookback window)
|
|
314
|
-
forecast_horizon: Number of steps to forecast
|
|
315
|
-
|
|
316
|
-
Returns:
|
|
317
|
-
tuple: (X, y) where X has shape (num_samples, sequence_length, num_features)
|
|
318
|
-
and y has shape (num_samples, forecast_horizon)
|
|
319
|
-
"""
|
|
320
|
-
if len(data.shape) == 1:
|
|
321
|
-
data = data.reshape(-1, 1)
|
|
322
|
-
|
|
323
|
-
X, y = [], []
|
|
324
|
-
for i in range(len(data) - sequence_length - forecast_horizon + 1):
|
|
325
|
-
X.append(data[i:(i + sequence_length)])
|
|
326
|
-
y.append(data[(i + sequence_length):(i + sequence_length + forecast_horizon), 0])
|
|
327
|
-
|
|
328
|
-
return np.array(X, dtype=np.float32), np.array(y, dtype=np.float32)
|
|
329
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|