Source code for rztdl.dl.constants.string_constants

# -*- coding: utf-8 -*-
"""
| *@created on:* 12/30/19,
| *@author:* Shubham,
| *@version:* v0.0.1
|
| *Description:*
|
| *Sphinx Documentation Status:*
|
"""
import enum
import typing
from typing import Union, List, Dict

import tensorflow as tf

TENSOR_OR_STR = Union[str, tf.Tensor]
RZT_INPUT_TYPE = Union[TENSOR_OR_STR, List[TENSOR_OR_STR], Dict[str, TENSOR_OR_STR]]
RZT_OUTPUT_TYPE = Union[str, List[str], Dict[str, str]]
INT_OR_ARRAY_OF_INT = Union[int, List[int]]
ARRAY_OF_INT = Union[List[int]]
ARRAY_OF_STRING = Union[str, List[str]]
from rztdl.utils.py_utils import AutoNameEnum


[docs]class Padding(AutoNameEnum): """ SAME:Same padding VALID: Valid Padding CASUAL: Casual Padding """ SAME = enum.auto() VALID = enum.auto() CASUAL = enum.auto()
[docs]class DataFormat(AutoNameEnum): """ CHANNELS_FIRST: (batch, height, width, channels) CHANNELS_LAST: (batch, channels, height, width) """ CHANNELS_FIRST = enum.auto() CHANNELS_LAST = enum.auto()
[docs]class IntervalType(AutoNameEnum): # TRAIN_START = enum.auto() TRAIN_END = enum.auto() # EPOCH_START = enum.auto() EPOCH_END = enum.auto() # BATCH_START = enum.auto() BATCH_END = enum.auto() RUN_END = enum.auto() SPLIT_END = enum.auto()
[docs]class AUCConstants(AutoNameEnum): """ ROC: ROC Curve PR: PR Curve """ ROC = enum.auto() PR = enum.auto()
[docs]class MergeMode(AutoNameEnum): """ SUM: Summation CONCAT: Concatenate MULTIPLY: Multiply AVERAGE: Average NONE: None """ SUM = "sum" CONCAT = "concat" MULTIPLY = "mul" AVERAGE = "ave" NONE = None
[docs]class BlueprintParameters: """ @author: Umesh Kumar BLUEPRINT_PARAMETERS Class **DO NOT MODIFY** """ DataType = "data_type"
[docs] class DataTypeOptions: INTEGER = "Integer" FLOAT = "Float" BOOLEAN = "Boolean" STRING = "String" COMPLEX = "Complex" LIST = "List" VARIABLE = "Variable" INT_OR_NDArray = "INTorNDArray" FLOAT_OR_NDArray = "FloatorNDArray" ARRAYOFINT = "ArrayofINT" ARRAYOFSTRING = "ArrayofString" ENUM = "Enum" NONE = None PYTHON_CODE = "PYTHON_CODE" OPTIMIZERSCOPES = "OptimizerScopes" DL_RANGE = 'DL_Range' TABLE_STATIC_ROWS = "TABLE_STATIC_ROWS" TABLE_DYNAMIC_ROWS = "TABLE_DYNAMIC_ROWS" BB_TRANSFER_LEARNING = "BB_TRANSFER_LEARNING"
# For constraints and new automated blueprint creation # TODO add all DataTypeOptions TYPE_MAP = { int: DataTypeOptions.INTEGER, float: DataTypeOptions.FLOAT, bool: DataTypeOptions.BOOLEAN, typing.List[str]: DataTypeOptions.ARRAYOFSTRING, typing.Union[str, typing.List]: DataTypeOptions.ARRAYOFSTRING, str: DataTypeOptions.STRING, typing.List[int]: DataTypeOptions.ARRAYOFINT, INT_OR_ARRAY_OF_INT: DataTypeOptions.ARRAYOFINT, ARRAY_OF_INT: DataTypeOptions.ARRAYOFINT, ARRAY_OF_STRING: DataTypeOptions.ARRAYOFSTRING }