From 84d0c6a8549110b3289fe9b32ea6438b115297da Mon Sep 17 00:00:00 2001 From: thomaswc Date: Mon, 8 Jan 2024 18:51:16 -0800 Subject: [PATCH] Add __init__.py files for timeseries directory. PiperOrigin-RevId: 596762385 --- .../python/experimental/BUILD | 2 ++ .../python/experimental/__init__.py | 2 ++ .../python/experimental/timeseries/BUILD | 9 +++++ .../experimental/timeseries/__init__.py | 36 +++++++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 tensorflow_probability/python/experimental/timeseries/__init__.py diff --git a/tensorflow_probability/python/experimental/BUILD b/tensorflow_probability/python/experimental/BUILD index 2239e43596..6ae164fef5 100644 --- a/tensorflow_probability/python/experimental/BUILD +++ b/tensorflow_probability/python/experimental/BUILD @@ -42,6 +42,7 @@ multi_substrate_py_library( "//tensorflow_probability/python/experimental/marginalize", "//tensorflow_probability/python/experimental/nn", "//tensorflow_probability/python/experimental/substrates", + "//tensorflow_probability/python/experimental/timeseries", "//tensorflow_probability/python/internal:auto_composite_tensor", "//tensorflow_probability/python/experimental/util:composite_tensor", ], @@ -65,6 +66,7 @@ multi_substrate_py_library( "//tensorflow_probability/python/experimental/sts_gibbs", "//tensorflow_probability/python/experimental/substrates", "//tensorflow_probability/python/experimental/tangent_spaces", + "//tensorflow_probability/python/experimental/timeseries", "//tensorflow_probability/python/experimental/util", "//tensorflow_probability/python/experimental/util:composite_tensor", "//tensorflow_probability/python/experimental/vi", diff --git a/tensorflow_probability/python/experimental/__init__.py b/tensorflow_probability/python/experimental/__init__.py index d7abd001d0..58a72d64ae 100644 --- a/tensorflow_probability/python/experimental/__init__.py +++ b/tensorflow_probability/python/experimental/__init__.py @@ -45,6 +45,7 @@ from tensorflow_probability.python.experimental import sts_gibbs from tensorflow_probability.python.experimental import substrates from tensorflow_probability.python.experimental import tangent_spaces +from tensorflow_probability.python.experimental import timeseries from tensorflow_probability.python.experimental import util from tensorflow_probability.python.experimental import vi from tensorflow_probability.python.experimental.util.composite_tensor import as_composite @@ -77,6 +78,7 @@ 'stats', 'substrates', 'tangent_spaces', + 'timeseries', 'unnest', 'util', 'vi', diff --git a/tensorflow_probability/python/experimental/timeseries/BUILD b/tensorflow_probability/python/experimental/timeseries/BUILD index cc2ee5c984..a524688577 100644 --- a/tensorflow_probability/python/experimental/timeseries/BUILD +++ b/tensorflow_probability/python/experimental/timeseries/BUILD @@ -24,6 +24,15 @@ package( default_visibility = ["//visibility:public"], ) +py_library( + name = "timeseries", + srcs = ["__init__.py"], + deps = [ + ":metrics", + "//tensorflow_probability/python/internal:all_util", + ], +) + py_library( name = "metrics", srcs = ["metrics.py"], diff --git a/tensorflow_probability/python/experimental/timeseries/__init__.py b/tensorflow_probability/python/experimental/timeseries/__init__.py new file mode 100644 index 0000000000..0da92d2f0a --- /dev/null +++ b/tensorflow_probability/python/experimental/timeseries/__init__.py @@ -0,0 +1,36 @@ +# Copyright 2024 The TensorFlow Probability Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ +"""Experimental methods and objectives for variational inference.""" + +from tensorflow_probability.python.experimental.timeseries.metrics import horizoned_mase +from tensorflow_probability.python.experimental.timeseries.metrics import horizoned_msis +from tensorflow_probability.python.experimental.timeseries.metrics import horizoned_smape +from tensorflow_probability.python.experimental.timeseries.metrics import mase +from tensorflow_probability.python.experimental.timeseries.metrics import msis +from tensorflow_probability.python.experimental.timeseries.metrics import smape +from tensorflow_probability.python.internal import all_util + +JAX_MODE = False + +_allowed_symbols = [ + 'smape', + 'horizoned_smape', + 'mase', + 'horizoned_mase', + 'msis', + 'horizoned_msis', +] + +all_util.remove_undocumented(__name__, _allowed_symbols)