How to use the polyaxon.libs.base_object.BaseObject function in polyaxon

To help you get started, we’ve selected a few polyaxon examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github polyaxon / polyaxon / polyaxon / layers / embeddings.py View on Github external
from __future__ import absolute_import, division, print_function

from collections import OrderedDict

try:
    from tensorflow.python.keras._impl.keras.layers import embeddings
except ImportError:
    from tensorflow.contrib.keras.python.keras.layers import embeddings

from polyaxon_schemas.layers.embeddings import EmbeddingConfig

from polyaxon.libs import getters
from polyaxon.libs.base_object import BaseObject


class Embedding(BaseObject, embeddings.Embedding):
    CONFIG = EmbeddingConfig
    __doc__ = EmbeddingConfig.__doc__

    def __init__(self,
                 input_dim,
                 output_dim,
                 embeddings_initializer='uniform',
                 embeddings_regularizer=None,
                 activity_regularizer=None,
                 embeddings_constraint=None,
                 mask_zero=False,
                 input_length=None,
                 **kwargs):
        super(Embedding, self).__init__(
            input_dim=input_dim,
            output_dim=output_dim,
github polyaxon / polyaxon / polyaxon / layers / pooling.py View on Github external
AveragePooling2DConfig,
    MaxPooling2DConfig,
    AveragePooling3DConfig,
    MaxPooling3DConfig,
    GlobalAveragePooling1DConfig,
    GlobalMaxPooling1DConfig,
    GlobalAveragePooling2DConfig,
    GlobalMaxPooling2DConfig,
    GlobalAveragePooling3DConfig,
    GlobalMaxPooling3DConfig
)

from polyaxon.libs.base_object import BaseObject


class AveragePooling1D(BaseObject, pooling.AveragePooling1D):
    CONFIG = AveragePooling1DConfig
    __doc__ = AveragePooling1DConfig.__doc__


class MaxPooling1D(BaseObject, pooling.MaxPooling1D):
    CONFIG = MaxPooling1DConfig
    __doc__ = MaxPooling1DConfig.__doc__


class AveragePooling2D(BaseObject, pooling.AveragePooling2D):
    CONFIG = AveragePooling2DConfig
    __doc__ = AveragePooling2DConfig.__doc__


class MaxPooling2D(BaseObject, pooling.MaxPooling2D):
    CONFIG = MaxPooling2DConfig
github polyaxon / polyaxon / polyaxon / constraints.py View on Github external
from polyaxon_schemas.constraints import (
    MaxNormConfig,
    NonNegConfig,
    UnitNormConfig,
    MinMaxNormConfig,
)

from polyaxon.libs.base_object import BaseObject


class MaxNorm(BaseObject, constraints.MaxNorm):
    CONFIG = MaxNormConfig
    __doc__ = constraints.MaxNorm.__doc__


class NonNeg(BaseObject, constraints.NonNeg):
    CONFIG = NonNegConfig
    __doc__ = constraints.NonNeg.__doc__


class UnitNorm(BaseObject, constraints.UnitNorm):
    CONFIG = UnitNormConfig
    __doc__ = constraints.UnitNorm.__doc__


class MinMaxNorm(BaseObject, constraints.MinMaxNorm):
    CONFIG = MinMaxNormConfig
    __doc__ = constraints.MinMaxNorm.__doc__


CONSTRAINTS = {
    MaxNorm.CONFIG.IDENTIFIER: MaxNorm,
github polyaxon / polyaxon / polyaxon / initializations.py View on Github external
class VarianceScaling(BaseObject, init_ops.VarianceScaling):
    CONFIG = initializations.VarianceScalingInitializerConfig
    __doc__ = init_ops.VarianceScaling.__doc__


class Orthogonal(BaseObject, init_ops.Orthogonal):
    CONFIG = initializations.OrthogonalInitializerConfig
    __doc__ = init_ops.Orthogonal.__doc__


class Identity(BaseObject, initializers.Identity):
    CONFIG = initializations.IdentityInitializerConfig
    __doc__ = initializers.Identity.__doc__


class GlorotUniform(BaseObject, init_ops.Initializer):
    CONFIG = initializations.GlorotUniformInitializerConfig
    __doc__ = initializers.glorot_uniform.__doc__

    def __init__(self, seed=None):
        self.seed = seed

    def __call__(self, shape, dtype=None, partition_info=None):
        return initializers.glorot_uniform(seed=self.seed)(shape, dtype)


class GlorotNormal(BaseObject, init_ops.Initializer):
    CONFIG = initializations.GlorotNormalInitializerConfig
    __doc__ = initializers.glorot_normal.__doc__

    def __init__(self, seed=None):
        self.seed = seed
github polyaxon / polyaxon / polyaxon / layers / pooling.py View on Github external
class MaxPooling2D(BaseObject, pooling.MaxPooling2D):
    CONFIG = MaxPooling2DConfig
    __doc__ = MaxPooling2DConfig.__doc__


class AveragePooling3D(BaseObject, pooling.AveragePooling3D):
    CONFIG = AveragePooling3DConfig
    __doc__ = AveragePooling3DConfig.__doc__


class MaxPooling3D(BaseObject, pooling.MaxPooling3D):
    CONFIG = MaxPooling3DConfig
    __doc__ = MaxPooling3DConfig.__doc__


class GlobalAveragePooling1D(BaseObject, pooling.GlobalAveragePooling1D):
    CONFIG = GlobalAveragePooling1DConfig
    __doc__ = GlobalAveragePooling1DConfig.__doc__


class GlobalMaxPooling1D(BaseObject, pooling.GlobalMaxPooling1D):
    CONFIG = GlobalMaxPooling1DConfig
    __doc__ = GlobalMaxPooling1DConfig.__doc__


class GlobalAveragePooling2D(BaseObject, pooling.GlobalAveragePooling2D):
    CONFIG = GlobalAveragePooling2DConfig
    __doc__ = GlobalAveragePooling2DConfig.__doc__


class GlobalMaxPooling2D(BaseObject, pooling.GlobalMaxPooling2D):
    CONFIG = GlobalMaxPooling2DConfig
github polyaxon / polyaxon / polyaxon / initializations.py View on Github external
class Constant(BaseObject, init_ops.Constant):
    CONFIG = initializations.ConstantInitializerConfig
    __doc__ = init_ops.Constant.__doc__


class Uniform(BaseObject, init_ops.RandomUniform):
    CONFIG = initializations.UniformInitializerConfig
    __doc__ = init_ops.RandomUniform.__doc__


class Normal(BaseObject, init_ops.RandomNormal):
    CONFIG = initializations.NormalInitializerConfig
    __doc__ = init_ops.RandomNormal.__doc__


class TruncatedNormal(BaseObject, init_ops.TruncatedNormal):
    CONFIG = initializations.TruncatedNormalInitializerConfig
    __doc__ = init_ops.TruncatedNormal.__doc__


class VarianceScaling(BaseObject, init_ops.VarianceScaling):
    CONFIG = initializations.VarianceScalingInitializerConfig
    __doc__ = init_ops.VarianceScaling.__doc__


class Orthogonal(BaseObject, init_ops.Orthogonal):
    CONFIG = initializations.OrthogonalInitializerConfig
    __doc__ = init_ops.Orthogonal.__doc__


class Identity(BaseObject, initializers.Identity):
    CONFIG = initializations.IdentityInitializerConfig
github polyaxon / polyaxon / polyaxon / initializations.py View on Github external
def __call__(self, shape, dtype=None, partition_info=None):
        return initializers.glorot_uniform(seed=self.seed)(shape, dtype)


class GlorotNormal(BaseObject, init_ops.Initializer):
    CONFIG = initializations.GlorotNormalInitializerConfig
    __doc__ = initializers.glorot_normal.__doc__

    def __init__(self, seed=None):
        self.seed = seed

    def __call__(self, shape, dtype=None, partition_info=None):
        return initializers.glorot_normal(seed=self.seed)(shape, dtype)


class HeUniform(BaseObject, init_ops.Initializer):
    CONFIG = initializations.HeUniformInitializerConfig
    __doc__ = initializers.he_uniform.__doc__

    def __init__(self, seed=None):
        self.seed = seed

    def __call__(self, shape, dtype=None, partition_info=None):
        return initializers.he_uniform(seed=self.seed)(shape, dtype)


class HeNormal(BaseObject, init_ops.Initializer):
    CONFIG = initializations.HeNormalInitializerConfig
    __doc__ = initializers.he_normal.__doc__

    def __init__(self, seed=None):
        self.seed = seed
github polyaxon / polyaxon / polyaxon / layers / core.py View on Github external
class SpatialDropout3D(BaseObject, core.SpatialDropout3D):
    CONFIG = SpatialDropout3DConfig
    __doc__ = SpatialDropout3DConfig.__doc__


class Activation(BaseObject, core.Activation):
    CONFIG = ActivationConfig
    __doc__ = ActivationConfig.__doc__


class Reshape(BaseObject, core.Reshape):
    CONFIG = ReshapeConfig
    __doc__ = ReshapeConfig.__doc__


class Permute(BaseObject, core.Permute):
    CONFIG = PermuteConfig
    __doc__ = PermuteConfig.__doc__


class Flatten(BaseObject, core.Flatten):
    CONFIG = FlattenConfig
    __doc__ = FlattenConfig.__doc__


class RepeatVector(BaseObject, core.RepeatVector):
    CONFIG = RepeatVectorConfig
    __doc__ = RepeatVectorConfig.__doc__


class Dense(BaseObject, core.Dense):
    CONFIG = DenseConfig
github polyaxon / polyaxon / polyaxon / layers / pooling.py View on Github external
class MaxPooling1D(BaseObject, pooling.MaxPooling1D):
    CONFIG = MaxPooling1DConfig
    __doc__ = MaxPooling1DConfig.__doc__


class AveragePooling2D(BaseObject, pooling.AveragePooling2D):
    CONFIG = AveragePooling2DConfig
    __doc__ = AveragePooling2DConfig.__doc__


class MaxPooling2D(BaseObject, pooling.MaxPooling2D):
    CONFIG = MaxPooling2DConfig
    __doc__ = MaxPooling2DConfig.__doc__


class AveragePooling3D(BaseObject, pooling.AveragePooling3D):
    CONFIG = AveragePooling3DConfig
    __doc__ = AveragePooling3DConfig.__doc__


class MaxPooling3D(BaseObject, pooling.MaxPooling3D):
    CONFIG = MaxPooling3DConfig
    __doc__ = MaxPooling3DConfig.__doc__


class GlobalAveragePooling1D(BaseObject, pooling.GlobalAveragePooling1D):
    CONFIG = GlobalAveragePooling1DConfig
    __doc__ = GlobalAveragePooling1DConfig.__doc__


class GlobalMaxPooling1D(BaseObject, pooling.GlobalMaxPooling1D):
    CONFIG = GlobalMaxPooling1DConfig
github polyaxon / polyaxon / polyaxon / layers / core.py View on Github external
class SpatialDropout1D(BaseObject, core.SpatialDropout1D):
    CONFIG = SpatialDropout1DConfig
    __doc__ = SpatialDropout1DConfig.__doc__


class SpatialDropout2D(BaseObject, core.SpatialDropout2D):
    CONFIG = SpatialDropout2DConfig
    __doc__ = SpatialDropout2DConfig.__doc__


class SpatialDropout3D(BaseObject, core.SpatialDropout3D):
    CONFIG = SpatialDropout3DConfig
    __doc__ = SpatialDropout3DConfig.__doc__


class Activation(BaseObject, core.Activation):
    CONFIG = ActivationConfig
    __doc__ = ActivationConfig.__doc__


class Reshape(BaseObject, core.Reshape):
    CONFIG = ReshapeConfig
    __doc__ = ReshapeConfig.__doc__


class Permute(BaseObject, core.Permute):
    CONFIG = PermuteConfig
    __doc__ = PermuteConfig.__doc__


class Flatten(BaseObject, core.Flatten):
    CONFIG = FlattenConfig