Home | History | Annotate | Download | only in bayesflow
      1 # Description:
      2 #   Contains ops for working with statistical distributions,
      3 #   particularly useful for Bayesian inference.
      4 #   APIs here are meant to evolve over time.
      5 
      6 package(default_visibility = [
      7     "//learning/brain/contrib/bayesflow:__subpackages__",
      8     "//tensorflow:__subpackages__",
      9 ])
     10 
     11 licenses(["notice"])  # Apache 2.0
     12 
     13 exports_files(["LICENSE"])
     14 
     15 load("//tensorflow:tensorflow.bzl", "cuda_py_test")
     16 
     17 py_library(
     18     name = "bayesflow_py",
     19     srcs = ["__init__.py"] + glob(["python/ops/*.py"]),
     20     srcs_version = "PY2AND3",
     21     deps = [
     22         "//tensorflow/contrib/distributions:distributions_py",
     23         "//tensorflow/contrib/framework:framework_py",
     24         "//tensorflow/python:array_ops",
     25         "//tensorflow/python:control_flow_ops",
     26         "//tensorflow/python:framework_for_generated_wrappers",
     27         "//tensorflow/python:functional_ops",
     28         "//tensorflow/python:gradients",
     29         "//tensorflow/python:math_ops",
     30         "//tensorflow/python:nn",
     31         "//tensorflow/python:nn_ops",
     32         "//tensorflow/python:platform",
     33         "//tensorflow/python:random_ops",
     34         "//tensorflow/python:state_ops",
     35         "//tensorflow/python:util",
     36         "//third_party/py/numpy",
     37     ],
     38 )
     39 
     40 cuda_py_test(
     41     name = "metropolis_hastings_test",
     42     size = "medium",
     43     srcs = ["python/kernel_tests/metropolis_hastings_test.py"],
     44     additional_deps = [
     45         ":bayesflow_py",
     46         "//third_party/py/numpy",
     47         "//tensorflow/python:array_ops",
     48         "//tensorflow/python:math_ops",
     49         "//tensorflow/python:client_testlib",
     50         "//tensorflow/python:framework",
     51         "//tensorflow/python:framework_for_generated_wrappers",
     52         "//tensorflow/python:platform_test",
     53         "//tensorflow/python:random_ops",
     54         "//tensorflow/python:variable_scope",
     55         "//tensorflow/python:variables",
     56     ],
     57 )
     58 
     59 cuda_py_test(
     60     name = "csiszar_divergence_test",
     61     size = "medium",
     62     srcs = ["python/kernel_tests/csiszar_divergence_test.py"],
     63     additional_deps = [
     64         ":bayesflow_py",
     65         "//third_party/py/numpy",
     66         "//tensorflow/contrib/distributions:distributions_py",
     67         "//tensorflow/python/ops/distributions",
     68         "//tensorflow/python:array_ops",
     69         "//tensorflow/python:client_testlib",
     70         "//tensorflow/python:framework_for_generated_wrappers",
     71         "//tensorflow/python:gradients",
     72         "//tensorflow/python:linalg_ops",
     73         "//tensorflow/python:math_ops",
     74         "//tensorflow/python:nn_ops",
     75     ],
     76     tags = [
     77         "manual",  # b/64490288
     78         "notap",
     79     ],
     80 )
     81 
     82 cuda_py_test(
     83     name = "custom_grad_test",
     84     size = "small",
     85     srcs = ["python/kernel_tests/custom_grad_test.py"],
     86     additional_deps = [
     87         ":bayesflow_py",
     88         "//third_party/py/numpy",
     89         "//tensorflow/contrib/layers:layers_py",
     90         "//tensorflow/python:array_ops",
     91         "//tensorflow/python:client_testlib",
     92         "//tensorflow/python:framework_for_generated_wrappers",
     93         "//tensorflow/python:framework_test_lib",
     94         "//tensorflow/python:gradients",
     95         "//tensorflow/python:init_ops",
     96         "//tensorflow/python:platform_test",
     97         "//tensorflow/python:variable_scope",
     98         "//tensorflow/python:variables",
     99     ],
    100 )
    101 
    102 cuda_py_test(
    103     name = "layers_conv_variational_test",
    104     size = "small",
    105     srcs = ["python/kernel_tests/layers_conv_variational_test.py"],
    106     additional_deps = [
    107         ":bayesflow_py",
    108         "//third_party/py/numpy",
    109         "//tensorflow/contrib/distributions:distributions_py",
    110         "//tensorflow/python/ops/distributions",
    111         "//tensorflow/python:array_ops",
    112         "//tensorflow/python:client_testlib",
    113         "//tensorflow/python:framework_for_generated_wrappers",
    114         "//tensorflow/python:gradients",
    115         "//tensorflow/python:linalg_ops",
    116         "//tensorflow/python:math_ops",
    117         "//tensorflow/python:nn_ops",
    118     ],
    119 )
    120 
    121 cuda_py_test(
    122     name = "layers_dense_variational_test",
    123     size = "small",
    124     srcs = ["python/kernel_tests/layers_dense_variational_test.py"],
    125     additional_deps = [
    126         ":bayesflow_py",
    127         "//third_party/py/numpy",
    128         "//tensorflow/contrib/distributions:distributions_py",
    129         "//tensorflow/python/ops/distributions",
    130         "//tensorflow/python:array_ops",
    131         "//tensorflow/python:client_testlib",
    132         "//tensorflow/python:framework_for_generated_wrappers",
    133         "//tensorflow/python:gradients",
    134         "//tensorflow/python:linalg_ops",
    135         "//tensorflow/python:math_ops",
    136         "//tensorflow/python:nn_ops",
    137     ],
    138 )
    139 
    140 cuda_py_test(
    141     name = "mcmc_diagnostics_test",
    142     size = "small",
    143     srcs = ["python/kernel_tests/mcmc_diagnostics_test.py"],
    144     additional_deps = [
    145         ":bayesflow_py",
    146         "//third_party/py/numpy",
    147         "//tensorflow/python:spectral_ops_test_util",
    148         "//tensorflow/contrib/distributions:distributions_py",
    149         "//tensorflow/python/ops/distributions",
    150         "//tensorflow/python:client_testlib",
    151         "//tensorflow/python:framework",
    152         "//tensorflow/python:framework_for_generated_wrappers",
    153         "//tensorflow/python:framework_test_lib",
    154         "//tensorflow/python:math_ops",
    155         "//tensorflow/python:platform_test",
    156         "//tensorflow/python:random_seed",
    157     ],
    158 )
    159 
    160 cuda_py_test(
    161     name = "monte_carlo_test",
    162     size = "small",
    163     srcs = ["python/kernel_tests/monte_carlo_test.py"],
    164     additional_deps = [
    165         ":bayesflow_py",
    166         "//third_party/py/numpy",
    167         "//tensorflow/contrib/distributions:distributions_py",
    168         "//tensorflow/contrib/layers:layers_py",
    169         "//tensorflow/python/ops/distributions",
    170         "//tensorflow/python:client_testlib",
    171         "//tensorflow/python:framework",
    172         "//tensorflow/python:framework_for_generated_wrappers",
    173         "//tensorflow/python:framework_test_lib",
    174         "//tensorflow/python:gradients",
    175         "//tensorflow/python:math_ops",
    176         "//tensorflow/python:platform_test",
    177         "//tensorflow/python:random_seed",
    178     ],
    179 )
    180 
    181 cuda_py_test(
    182     name = "halton_sequence_test",
    183     size = "small",
    184     srcs = ["python/kernel_tests/halton_sequence_test.py"],
    185     additional_deps = [
    186         ":bayesflow_py",
    187         "//third_party/py/numpy",
    188         "//tensorflow/python:array_ops",
    189         "//tensorflow/python:math_ops",
    190         "//tensorflow/python:client_testlib",
    191         "//tensorflow/python:framework",
    192         "//tensorflow/python:framework_for_generated_wrappers",
    193         "//tensorflow/python:platform_test",
    194         "//tensorflow/python:random_ops",
    195         "//tensorflow/python:variable_scope",
    196         "//tensorflow/python:variables",
    197     ],
    198     tags = ["no_mac"],  # b/73192243
    199 )
    200 
    201 cuda_py_test(
    202     name = "hmc_test",
    203     size = "medium",
    204     srcs = ["python/kernel_tests/hmc_test.py"],
    205     additional_deps = [
    206         ":bayesflow_py",
    207         "//third_party/py/numpy",
    208         "//tensorflow/contrib/distributions:distributions_py",
    209         "//tensorflow/contrib/layers:layers_py",
    210         "//tensorflow/python/ops/distributions",
    211         "//tensorflow/python:client_testlib",
    212         "//tensorflow/python:framework",
    213         "//tensorflow/python:framework_for_generated_wrappers",
    214         "//tensorflow/python:framework_test_lib",
    215         "//tensorflow/python:gradients",
    216         "//tensorflow/python:math_ops",
    217         "//tensorflow/python:platform_test",
    218         "//tensorflow/python:random_seed",
    219     ],
    220 )
    221 
    222 cuda_py_test(
    223     name = "sgld_optimizer_test",
    224     size = "small",
    225     srcs = ["python/kernel_tests/sgld_optimizer_test.py"],
    226     additional_deps = [
    227         ":bayesflow_py",
    228         "//third_party/py/numpy",
    229         "//tensorflow/contrib/distributions:distributions_py",
    230         "//tensorflow/contrib/layers:layers_py",
    231         "//tensorflow/python/ops/distributions",
    232         "//tensorflow/python:client_testlib",
    233         "//tensorflow/python:framework",
    234         "//tensorflow/python:framework_for_generated_wrappers",
    235         "//tensorflow/python:framework_test_lib",
    236         "//tensorflow/python:gradients",
    237         "//tensorflow/python:math_ops",
    238         "//tensorflow/python:platform_test",
    239         "//tensorflow/python:random_seed",
    240     ],
    241     tags = ["notsan"],
    242 )
    243 
    244 cuda_py_test(
    245     name = "variable_utils_test",
    246     size = "small",
    247     srcs = ["python/kernel_tests/variable_utils_test.py"],
    248     additional_deps = [
    249         ":bayesflow_py",
    250         "//third_party/py/numpy",
    251         "//tensorflow/python:client_testlib",
    252         "//tensorflow/python:framework",
    253         "//tensorflow/python:framework_for_generated_wrappers",
    254         "//tensorflow/python:framework_test_lib",
    255         "//tensorflow/python:gradients",
    256         "//tensorflow/python:math_ops",
    257         "//tensorflow/python:platform_test",
    258     ],
    259 )
    260 
    261 cuda_py_test(
    262     name = "variational_sgd_optimizer_test",
    263     size = "small",
    264     srcs = ["python/kernel_tests/variational_sgd_optimizer_test.py"],
    265     additional_deps = [
    266         ":bayesflow_py",
    267         "//third_party/py/numpy",
    268         "//tensorflow/contrib/distributions:distributions_py",
    269         "//tensorflow/contrib/layers:layers_py",
    270         "//tensorflow/python/ops/distributions",
    271         "//tensorflow/python:client_testlib",
    272         "//tensorflow/python:framework",
    273         "//tensorflow/python:framework_for_generated_wrappers",
    274         "//tensorflow/python:framework_test_lib",
    275         "//tensorflow/python:gradients",
    276         "//tensorflow/python:math_ops",
    277         "//tensorflow/python:platform_test",
    278         "//tensorflow/python:random_seed",
    279     ],
    280     tags = ["notsan"],
    281 )
    282 
    283 filegroup(
    284     name = "all_files",
    285     srcs = glob(
    286         ["**/*"],
    287         exclude = [
    288             "**/METADATA",
    289             "**/OWNERS",
    290         ],
    291     ),
    292     visibility = ["//tensorflow:__subpackages__"],
    293 )
    294