google-research

Форк
0
51 строка · 1.8 Кб
1
# coding=utf-8
2
# Copyright 2024 The Google Research Authors.
3
#
4
# Licensed under the Apache License, Version 2.0 (the "License");
5
# you may not use this file except in compliance with the License.
6
# You may obtain a copy of the License at
7
#
8
#     http://www.apache.org/licenses/LICENSE-2.0
9
#
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under the License is distributed on an "AS IS" BASIS,
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
# See the License for the specific language governing permissions and
14
# limitations under the License.
15

16
"""Runs distributional-skew UQ experiments on MNIST.
17

18
Lightweight wrapper around experiment.py -- mostly useful to keep flags and
19
py_binary boilerplate out of colab during development.
20
"""
21

22
from __future__ import absolute_import
23
from __future__ import division
24
from __future__ import print_function
25

26
from absl import app
27
from absl import flags
28
from uq_benchmark_2019.mnist import experiment
29
from uq_benchmark_2019.mnist import models_lib
30

31
FLAGS = flags.FLAGS
32
flags.DEFINE_enum('arch', None, models_lib.ARCHITECTURES,
33
                  'Name of NN architecture.')
34
flags.DEFINE_enum('method', None, models_lib.METHODS,
35
                  'Name of modeling method.')
36
flags.DEFINE_string('output_dir', None, 'Output directory.')
37

38
flags.DEFINE_integer('test_level', 0,
39
                     '(0) no testing, (1) quick training (2) fake data.')
40
flags.DEFINE_integer('task', 0, 'Task number.')
41

42

43
def main(argv):
44
  if len(argv) > 1:
45
    raise app.UsageError('Too many command-line arguments.')
46
  experiment.run(FLAGS.method, FLAGS.arch,
47
                 FLAGS.output_dir.replace('%task%', str(FLAGS.task)),
48
                 test_level=FLAGS.test_level)
49

50
if __name__ == '__main__':
51
  app.run(main)
52

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.