tfc.layers.IdentityInitializer  |  TensorFlow v2.16.1 Skip to main content Install Learn Introduction New to TensorFlow? Tutorials Learn how to use TensorFlow with end-to-end examples Guide Learn framework concepts and components Learn ML Educational resources to master your path with TensorFlow API TensorFlow (v2.16.1) Versions… TensorFlow.js TensorFlow Lite TFX Ecosystem LIBRARIES TensorFlow.js Develop web ML applications in JavaScript TensorFlow Lite Deploy ML on mobile, microcontrollers and other edge devices TFX Build production ML pipelines All libraries Create advanced models and extend TensorFlow RESOURCES Models & datasets Pre-trained models and datasets built by Google and the community Tools Tools to support and accelerate TensorFlow workflows Responsible AI Resources for every stage of the ML workflow Recommendation systems Build recommendation systems with open source tools Community Groups User groups, interest groups and mailing lists Contribute Guide for contributing to code and documentation Blog Stay up to date with all things TensorFlow Forum Discussion platform for the TensorFlow community Why TensorFlow About Case studies / English 中文 – 简体 GitHub Sign in TensorFlow v2.16.1 Overview Python C++ Java More Install Learn More API More Overview Python C++ Java More Ecosystem More Community More Why TensorFlow More GitHub Overview TensorFlow Models tfm Overview tfm.core Overview actions Overview EMACheckpointing PruningAction RecoveryAction RecoveryCondition get_eval_actions get_train_actions base_task Overview DifferentialPrivacyConfig RuntimeConfig Task base_trainer Overview ExperimentConfig Trainer TrainerConfig get_runtime_options config_definitions Overview DataConfig TaskConfig exp_factory Overview get_exp_config register_config_factory export_base Overview ExportModule export get_timestamped_export_dir file_writers Overview write_small_dataset input_reader Overview InputReader match_files registry Overview lookup register savedmodel_checkpoint_manager Overview SavedModelCheckpointManager make_saved_modules_directory_name task_factory Overview get_task get_task_cls register_task_cls tf_example_builder Overview BytesValueType TfExampleBuilder tf_example_feature_key Overview TfExampleFeatureKeyBase dataclass train_lib Overview OrbitExperimentRunner maybe_create_best_ckpt_exporter run_experiment train_utils Overview BestCheckpointExporter ExperimentParser ParseConfigOptions cast_leaf_nested_dict convert_variables_to_constants_v2_as_graph create_optimizer create_trainer get_leaf_nested_dict parse_configuration read_global_step_from_checkpoint remove_ckpts save_gin_config serialize_config try_count_flops try_count_params write_json_summary write_model_params write_summary tfm.hyperparams Overview Config OneOfConfig ParamsDict bind nested_csv_str_to_json_str override_params_dict read_yaml_to_params_dict save_params_dict_to_yaml base_config Overview oneof Overview params_dict Overview tfm.nlp Overview encoders Overview AlbertEncoderConfig BertEncoderConfig BigBirdEncoderConfig EncoderConfig FNetEncoderConfig FunnelEncoderConfig KernelEncoderConfig MobileBertEncoderConfig QueryBertConfig ReuseEncoderConfig SparseMixerEncoderConfig XLNetEncoderConfig build_encoder layers Overview BertPackInputs BertTokenizer BigBirdAttention BigBirdMasks BlockDiagFeedforward CachedAttention ClassificationHead ExpertsChooseMaskedRouter FactorizedEmbedding FastWordpieceBertTokenizer FeedForwardExperts FourierTransformLayer GatedFeedforward GaussianProcessClassificationHead HartleyTransformLayer KernelAttention KernelMask LinearTransformLayer MaskedLM MaskedSoftmax MatMulWithMargin MixingMechanism MobileBertEmbedding MobileBertMaskedLM MobileBertTransformer MoeLayer MoeLayerWithBackbone MultiChannelAttention MultiClsHeads MultiHeadRelativeAttention OnDeviceEmbedding PackBertEmbeddings PerDimScaleAttention PerQueryDenseHead PositionEmbedding RandomFeatureGaussianProcess ReZeroTransformer RelativePositionBias RelativePositionEmbedding ReuseMultiHeadAttention ReuseTransformer SelectTopK SelfAttentionMask SentencepieceTokenizer SpectralNormalization SpectralNormalizationConv2D StridedTransformerEncoderBlock StridedTransformerScaffold TNTransformerExpandCondense TalkingHeadsAttention TokenImportanceWithMovingAvg Transformer TransformerDecoderBlock TransformerEncoderBlock TransformerScaffold TransformerXL TransformerXLBlock TwoStreamRelativeAttention VotingAttention extract_gp_layer_kwargs extract_spec_norm_kwargs get_mask util Overview TfFunctionIfEagerDecorator filter_kwargs tf_function_if_eager losses Overview weighted_sparse_categorical_crossentropy_loss models Overview BertClassifier BertPretrainer BertPretrainerV2 BertSpanLabeler BertTokenClassifier DualEncoder ElectraPretrainer Seq2SeqTransformer T5Transformer T5TransformerParams TransformerDecoder TransformerEncoder XLNetClassifier XLNetPretrainer XLNetSpanLabeler attention_initializer networks Overview AlbertEncoder BertEncoder BertEncoderV2 Classification EncoderScaffold FNet FunnelTransformerEncoder MobileBERTEncoder PackedSequenceEmbedding SpanLabeling SparseMixer XLNetBase XLNetSpanLabeling ops Overview SamplingModule SequenceBeamSearch get_next_sentence_labels get_sentence_order_labels sequence_beam_search serving_modules Overview MaskedLM MaskedLM.Params QuestionAnswering QuestionAnswering.Params SentencePrediction SentencePrediction.Params Tagging Tagging.Params Translation Translation.Params features_to_int32 tasks Overview ElectraPretrainConfig ElectraPretrainTask MaskedLMConfig MaskedLMTask QuestionAnsweringConfig QuestionAnsweringTask SentencePredictionConfig SentencePredictionTask TaggingConfig TaggingTask TranslationConfig TranslationTask tfm.optimization Overview AdafactorConfig AdagradConfig AdamConfig AdamExperimentalConfig AdamWeightDecayConfig AdamWeightDecayExperimentalConfig BaseOptimizerConfig ConstantLrConfig CosineDecayWithOffset CosineDecayWithOffset.base_lr_class CosineLrConfig DirectPowerDecay DirectPowerLrConfig EMAConfig ExponentialDecayWithOffset ExponentialDecayWithOffset.base_lr_class ExponentialLrConfig ExponentialMovingAverage LAMBConfig LARSConfig LinearWarmup LinearWarmupConfig LrConfig OptimizationConfig OptimizerConfig OptimizerFactory PiecewiseConstantDecayWithOffset PiecewiseConstantDecayWithOffset.base_lr_class PolynomialDecayWithOffset PolynomialDecayWithOffset.base_lr_class PolynomialLrConfig PolynomialWarmUp PolynomialWarmupConfig PowerAndLinearDecay PowerAndLinearDecayLrConfig PowerDecayWithOffset PowerDecayWithOffsetLrConfig RMSPropConfig SGDConfig SGDExperimentalConfig SLIDEConfig StepCosineDecayWithOffset StepCosineLrConfig StepwiseLrConfig WarmupConfig register_optimizer_cls adafactor_optimizer Overview configs Overview ema_optimizer Overview maybe_merge_call lamb Overview FloatTensorLike LAMB lars Overview LARS legacy_adamw Overview AdamWeightDecay lr_cfg Overview lr_schedule Overview math Overview acos acosh asin asinh atan atan2 atanh ceil comb copysign cos cosh degrees dist erf erfc exp expm1 fabs factorial floor fmod frexp fsum gamma gcd hypot isclose isfinite isinf isnan isqrt lcm ldexp lgamma log log10 log1p log2 modf nextafter perm pow prod radians remainder sin sinh sqrt tan tanh trunc ulp opt_cfg Overview optimizer_factory Overview slide_optimizer Overview tfm.utils Overview assert_rank clone_initializer cross_replica_concat deserialize_keras_object get_activation get_replica_id get_shape_list is_special_none_tensor pack_inputs safe_mean serialize_activation serialize_constraint serialize_initializer serialize_keras_object serialize_layer serialize_regularizer unpack_inputs activations Overview gelu hard_sigmoid hard_swish identity mish relu6 simple_swish tfm.vision Overview ImageClassificationTask MaskRCNNTask RetinaNetTask SemanticSegmentationTask VideoClassificationTask anchor Overview Anchor AnchorLabeler RpnAnchorLabeler build_anchor_generator unpack_targets anchor_generator Overview AnchorGenerator maybe_map_structure_for_anchor augment Overview AutoAugment ImageAugment MixupAndCutmix RandAugment RandomErasing autocontrast bbox_wrapper blend brightness color contrast cutout cutout_video equalize from_4d gaussian_filter2d gaussian_noise grayscale invert level_to_arg posterize rotate rotate_with_bboxes select_and_apply_random_policy sharpness shear_with_bboxes shear_x shear_y solarize solarize_add to_4d transform translate translate_bbox translate_x translate_y translate_y_only_bboxes unwrap wrap wrapped_rotate backbones Overview DilatedResNet EfficientNet MobileDet MobileNet ResNet ResNet3D RevNet SpineNet SpineNetMobile VisionTransformer box_matcher Overview BoxMatcher box_ops Overview bbox2mask bbox_generalized_overlap bbox_intersection_over_area bbox_overlap box_matching clip_boxes compute_outer_boxes cycxhw_to_yxyx decode_boxes denormalize_boxes encode_boxes filter_boxes filter_boxes_by_scores gather_instances get_non_empty_box_indices horizontal_flip_boxes jitter_boxes normalize_boxes top_k_boxes vertical_flip_boxes yxyx_to_cycxhw yxyx_to_xywh classification_model Overview ClassificationModel configs Overview backbones Overview Backbone DilatedResNet EfficientNet MobileDet MobileNet ResNet RevNet SpineNet SpineNetMobile Transformer VisionTransformer backbones_3d Overview Backbone3D ResNet3D ResNet3D50 ResNet3DBlock ResNet3DRS common Overview Augmentation AutoAugment DataDecoder MixupAndCutmix NormActivation PseudoLabelDataConfig RandAugment RandomErasing TFLitePostProcessingConfig TfExampleDecoder TfExampleDecoderLabelMap image_classification Overview DataConfig Evaluation ImageClassificationModel ImageClassificationTask Losses image_classification image_classification_imagenet image_classification_imagenet_deit_pretrain image_classification_imagenet_mobilenet image_classification_imagenet_resnetrs image_classification_imagenet_revnet image_classification_imagenet_vit_finetune image_classification_imagenet_vit_pretrain maskrcnn Overview Anchor DataConfig DetectionGenerator DetectionHead Losses MaskHead MaskRCNN MaskRCNNTask MaskROIAligner MaskSampler Parser ROIAligner ROIGenerator ROISampler RPNHead cascadercnn_spinenet_coco fasterrcnn_resnetfpn_coco maskrcnn_mobilenet_coco maskrcnn_resnetfpn_coco maskrcnn_spinenet_coco retinanet Overview Anchor AttributeHead DataConfig DataDecoder DetectionGenerator ExportConfig Losses Parser RetinaNet RetinaNetHead RetinaNetTask TfExampleDecoder TfExampleDecoderLabelMap retinanet retinanet_resnetfpn_coco retinanet_spinenet_coco retinanet_spinenet_mobile_coco semantic_segmentation Overview DataConfig DenseFeatureConfig Evaluation ExportConfig Losses MaskScoringHead SegmentationHead SemanticSegmentationModel SemanticSegmentationTask mnv2_deeplabv3_cityscapes mnv2_deeplabv3_pascal mnv2_deeplabv3plus_cityscapes seg_deeplabv3_pascal seg_deeplabv3plus_cityscapes seg_deeplabv3plus_pascal seg_resnetfpn_pascal semantic_segmentation video_classification Overview DataConfig Losses Metrics VideoClassificationModel VideoClassificationTask add_trainer kinetics400 kinetics600 kinetics700 kinetics700_2020 video_classification video_classification_kinetics400 video_classification_kinetics600 video_classification_kinetics700 video_classification_kinetics700_2020 video_classification_ucf101 decoders Overview ASPP FPN NASFPN factory Overview build_classification_model build_maskrcnn build_retinanet build_segmentation_model factory_3d Overview build_model build_video_classification_model register_model_builder heads Overview DetectionHead MaskHead MaskScoring RPNHead RetinaNetHead SegmentationHead image_classification Overview iou_similarity Overview IouSimilarity area intersection iou layers Overview BottleneckBlock BottleneckBlock3D BottleneckResidualInner BoxSampler CausalConvMixin Conv2D Conv3D DepthwiseConv2D DepthwiseSeparableConvBlock DetectionGenerator GlobalAveragePool3D InvertedBottleneckBlock MaskSampler MultilevelDetectionGenerator MultilevelROIAligner MultilevelROIGenerator PositionalEncoding ROISampler ResidualBlock ResidualInner ReversibleLayer Scale SelfGating SpatialAveragePool3D SqueezeExcitation StochasticDepth TemporalSoftmaxPool mask_ops Overview instance_masks_overlap paste_instance_masks paste_instance_masks_v2 maskrcnn Overview zero_out_disallowed_class_ids maskrcnn_model Overview MaskRCNNModel models Overview RetinaNetModel SegmentationModel VideoClassificationModel nms Overview sorted_non_max_suppression_padded preprocess_ops Overview center_crop_image center_crop_image_v2 clip_or_pad_to_fixed_size color_jitter compute_padded_size horizontal_flip_image horizontal_flip_masks normalize_image normalize_scaled_float_image random_brightness random_contrast random_crop random_crop_image random_crop_image_v2 random_crop_image_with_boxes_and_labels random_horizontal_flip random_horizontal_flip_with_roi random_saturation random_vertical_flip range resize_and_crop_boxes resize_and_crop_image resize_and_crop_image_v2 resize_and_crop_masks resize_image preprocess_ops_3d Overview crop_image decode_image decode_jpeg normalize_image random_crop_resize random_flip_left_right resize_smallest sample_linspace_sequence sample_segment_sequence sample_sequence retinanet Overview retinanet_model Overview sampling_ops Overview BalancedPositiveNegativeSampler combined_static_and_dynamic_shape indices_to_dense_vector matmul_gather_on_zeroth_axis segmentation_model Overview semantic_segmentation Overview serving Overview export_saved_model_lib Overview export_inference_graph spatial_transform_ops Overview bilinear_resize bilinear_resize_to_bbox bilinear_resize_with_crop_and_pad bilinear_resize_with_pad crop_mask_in_target_box multilevel_crop_and_resize nearest_upsampling target_gather Overview TargetGather video_classification Overview video_classification_model Overview Orbit orbit Overview AbstractEvaluator AbstractTrainer Action Controller StandardEvaluator StandardEvaluatorOptions StandardTrainer StandardTrainerOptions orbit.actions Overview ConditionalAction ExportFileManager ExportSavedModel JSONPersistedValue NewBestMetric SaveCheckpointIfPreempted orbit.utils Overview EpochHelper LoopFnWithSummaries OptionalSummariesFunction SummaryManager SummaryManagerInterface create_global_step create_loop_fn create_tf_while_loop_fn get_value make_distributed_dataset TensorFlow Compression tfc Overview PackedTensors Y4MDataset tfc.distributions Overview DeepFactorized MonotonicAdapter NoisyDeepFactorized NoisyLaplace NoisyLogistic NoisyLogisticMixture NoisyMixtureSameFamily NoisyNormal NoisyNormalMixture NoisyRoundedDeepFactorized NoisyRoundedNormal NoisySoftRoundedDeepFactorized NoisySoftRoundedNormal RoundAdapter SoftRoundAdapter UniformNoiseAdapter estimate_tails lower_tail quantization_offset upper_tail tfc.entropy_models Overview ContinuousBatchedEntropyModel ContinuousIndexedEntropyModel LaplaceEntropyModel LocationScaleIndexedEntropyModel PowerLawEntropyModel UniversalBatchedEntropyModel UniversalIndexedEntropyModel tfc.layers Overview GDN GDNParameter IdentityInitializer Parameter RDFTParameter SignalConv1D SignalConv2D SignalConv3D SoftRound SoftRoundConditionalMean tfc.ops Overview create_range_decoder create_range_encoder entropy_decode_channel entropy_decode_finalize entropy_decode_index entropy_encode_channel entropy_encode_finalize entropy_encode_index lower_bound perturb_and_apply pmf_to_quantized_cdf round_st run_length_decode run_length_encode run_length_gamma_decode run_length_gamma_encode same_padding_for_kernel soft_round soft_round_conditional_mean soft_round_inverse stochastic_round upper_bound Introduction Tutorials Guide Learn ML TensorFlow (v2.16.1) Versions… TensorFlow.js TensorFlow Lite TFX LIBRARIES TensorFlow.js TensorFlow Lite TFX All libraries RESOURCES Models & datasets Tools Responsible AI Recommendation systems Groups Contribute Blog Forum About Case studies TensorFlow API TensorFlow v2.16.1 More tfc.layers.IdentityInitializer Stay organized with collections Save and categorize content based on your preferences. View source on GitHub Initialize to the identity kernel with the given shape. View aliases Main aliases tfc.IdentityInitializer tfc.layers.IdentityInitializer( gain=1 ) This creates an n-D kernel suitable for SignalConv* with the requested support that produces an output identical to its input (except possibly at the signal boundaries). Note: The identity initializer in tf.keras.initializers is only suitable for matrices, not for n-D convolution kernels (i.e., no spatial support). Methods from_config @classmethod from_config( config ) Instantiates an initializer from a configuration dictionary. Example: initializer = RandomUniform(-1, 1) config = initializer.get_config() initializer = RandomUniform.from_config(config) Args config A Python dictionary, the output of get_config(). Returns An Initializer instance. get_config View source get_config() Returns the initializer's configuration as a JSON-serializable dict. Returns A JSON-serializable Python dict. __call__ View source __call__( shape, dtype=None, **kwargs ) Returns a tensor object initialized as specified by the initializer. Args shape Shape of the tensor. dtype Optional dtype of the tensor. **kwargs Additional keyword arguments. Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license. Last updated 2024-04-26 UTC. [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[]] Stay connected Blog Forum GitHub Twitter YouTube Support Issue tracker Release notes Stack Overflow Brand guidelines Cite TensorFlow Terms Privacy Manage cookies Sign up for the TensorFlow newsletter Subscribe English 中文 – 简体