Tensorflow 2.0 函数手册
- 前言
- tensorflow.audio
- tensorflow.audio.decode_wav
- tensorflow.audio.encode_wav
- tensorflow.autograph
- tensorflow.autograph.experimental
- tensorflow.autograph.experimental.do_not_convert()
- tensorflow.autograph.experimental.set_loop_options()
- tensorflow.autograph.set_verbosity()
- tensorflow.argmax()
- tensorflow.batch_to_space
- tensorflow.bfloat16
- tensorflow.bitcast
- tensorflow.bitwise
- tensorflow.bool
- tensorflow.boolean_mask
- tensorflow.cast()
- tensorflow.compat
- tensorflow.compiler
- tensorflow.concat()
- tensorflow.constant()
- tensorflow.config
- tensorflow.config.experimental
- tensorflow.config.experimental.list_physical_devices()
- tensorflow.config.experimental.set_memory_growth()
- tensorflow.contrib
- tensorflow.convert_to_tensor()
- tensorflow.core
- tensorflow.core.debug
- tensorflow.core.example
- tensorflow.core.framework
- tensorflow.core.grappler
- tensorflow.core.kernels
- tensorflow.core.lib
- tensorflow.core.profiler
- tensorflow.core.protobuf
- tensorflow.core.util
- tensorflow.core.util.event_pb2
- tensorflow.core.util.memmapped_file_system_pb2
- tensorflow.core.util.saved_tensor_slice_pb2
- tensorflow.core.util.test_log_pb2
- tensorflow.data
- tensorflow.data.Dataset
- tensorflow.data.Dataset.from_tensor_slices()
- tensorflow.data.Dataset.list_files()
- tensorflow.data.Dataset.list_files.flat_map()
- tensorflow.data.TFRecordDataset
- tensorflow.data.experimental.AUTOTUNE
- tensorflow.data.Iterator
- tensorflow.debugging
- tensorflow.distribute
- tensorflow.distribute.OneDeviceStrategy()
- tensorflow.dtypes
- tensorflow.equal()
- tensorflow.errors
- tensorflow.estimator
- tensorflow.examples
- tensorflow.examples.saved_model
- tensorflow.examples.saved_model.integration_tests.mnist_util
- tensorflow.exp()
- tensorflow.expand_dims() #函数
- tensorflow.experimental
- tensorflow.experimental.function_executor_type
- tensorflow.flat_map()
- tensorflow.feature_column
- tensorflow.feature_column.bucketized_column
- tensorflow.feature_column.categorical_column_with_hash_bucket
- tensorflow.feature_column.categorical_column_with_identity
- tensorflow.feature_column.categorical_column_with_vocabulary_file
- tensorflow.feature_column.categorical_column_with_vocabulary_list
- tensorflow.feature_column.crossed_column
- tensorflow.feature_column.embedding_column
- tensorflow.feature_column.indicator_column
- tensorflow.feature_column.make_parse_example_spec
- tensorflow.feature_column.numeric_column
- tensorflow.feature_column.sequence_categorical_column_with_hash_bucket
- tensorflow.feature_column.sequence_categorical_column_with_identity
- tensorflow.feature_column.sequence_categorical_column_with_vocabulary_file
- tensorflow.feature_column.sequence_categorical_column_with_vocabulary_list
- tensorflow.feature_column.sequence_numeric_column
- tensorflow.feature_column.shared_embeddings
- tensorflow.float32
- tensorflow.gather
- tensorflow.gather_nd
- tensorflow.graph_util
- tensorflow.graph_util.import_graph_def
- tensorflow.GradientTape
- tensorflow.image
- tensorflow.image.adjust_brightness
- tensorflow.image.adjust_contrast
- tensorflow.image.adjust_gamma
- tensorflow.image.adjust_hue
- tensorflow.image.adjust_jpeg_quality
- tensorflow.image.adjust_saturation
- tensorflow.image.central_crop
- tensorflow.image.combined_non_max_suppression
- tensorflow.image.convert_image_dtype
- tensorflow.image.crop_and_resize
- tensorflow.image.crop_to_bounding_box
- tensorflow.image.decode_and_crop_jpeg
- tensorflow.image.decode_bmp
- tensorflow.image.decode_gif
- tensorflow.image.decode_image
- tensorflow.image.decode_jpeg
- tensorflow.image.decode_png
- tensorflow.image.draw_bounding_boxes
- tensorflow.image.encode_jpeg
- tensorflow.image.encode_png
- tensorflow.image.extract_glimpse
- tensorflow.image.extract_jpeg_shape
- tensorflow.image.extract_patches
- tensorflow.image.flip_left_right
- tensorflow.image.flip_up_down
- tensorflow.image.grayscale_to_rgb
- tensorflow.image.hsv_to_rgb
- tensorflow.image.image_gradients
- tensorflow.image.is_jpeg
- tensorflow.image.non_max_suppression
- tensorflow.image.non_max_suppression_overlaps
- tensorflow.image.non_max_suppression_padded
- tensorflow.image.non_max_suppression_with_scores
- tensorflow.image.pad_to_bounding_box
- tensorflow.image.per_image_standardization
- tensorflow.image.psnr
- tensorflow.image.random_brightness
- tensorflow.image.random_contrast
- tensorflow.image.random_crop
- tensorflow.image.random_flip_left_right
- tensorflow.image.random_flip_up_down
- tensorflow.image.random_hue
- tensorflow.image.random_jpeg_quality
- tensorflow.image.random_saturation
- tensorflow.image.resize
- tensorflow.image.resize_with_crop_or_pad
- tensorflow.image.resize_with_pad
- tensorflow.image.rgb_to_grayscale
- tensorflow.image.rgb_to_hsv
- tensorflow.image.rgb_to_yiq
- tensorflow.image.rgb_to_yuv
- tensorflow.image.rot90
- tensorflow.image.sample_distorted_bounding_box
- tensorflow.image.sobel_edges
- tensorflow.image.ssim
- tensorflow.image.ssim_multiscale
- tensorflow.image.total_variation
- tensorflow.image.transpose
- tensorflow.image.yiq_to_rgb
- tensorflow.image.yuv_to_rgb
- tensorflow.image.resize()
- tensorflow.include
- tensorflow.initializers
- tensorflow.int32
- tensorflow.int64
- tensorflow.io
- tensorflow.io.FixedLenFeature()
- tensorflow.io.parse_single_example()
- tensorflow.io.read_file()
- tensorflow.io.decode_and_crop_jpeg
- tensorflow.io.decode_base64
- tensorflow.io.decode_bmp
- tensorflow.io.decode_compressed
- tensorflow.io.decode_csv
- tensorflow.io.decode_gif
- tensorflow.io.decode_image
- tensorflow.io.decode_jpeg
- tensorflow.io.decode_json_example
- tensorflow.io.decode_png
- tensorflow.io.decode_proto
- tensorflow.io.decode_raw
- tensorflow.io.deserialize_many_sparse
- tensorflow.io.TFRecordWriter()
- tensorflow.io.VarLenFeature()
- tensorflow.keras
- tensorflow.keras.applications.MobileNetV2
- tensorflow.keras.callbacks
- tensorflow.keras.callbacks.ReduceLROnPlateau #类
- tensorflow.keras.callbacks.EarlyStopping #类
- tensorflow.keras.callbacks.ModelCheckpoint #类
- tensorflow.keras.callbacks.TensorBoard #类
- tensorflow.keras.layers.Add
- tensorflow.keras.layers.Concatenate
- tensorflow.keras.layers.Conv2D
- tensorflow.keras.layers.Conv2DTranspose()
- tensorflow.keras.layers.Input #类
- tensorflow.keras.layers.Lambda
- tensorflow.keras.layers.LeakyReLU
- tensorflow.keras.layers.MaxPool2D
- tensorflow.keras.layers.UpSampling2D
- tensorflow.keras.layers.ZeroPadding2D
- tensorflow.keras.losses
- tensorflow.keras.losses.binary_crossentropy
- tensorflow.keras.losses.sparse_categorical_crossentropy
- tensorflow.keras.metrics.Mean() #类
- tensorflow.keras.metrics.Mean.result()
- tensorflow.keras.metrics.Mean.reset_states()
- tensorflow.keras.metrics.Mean.update_state()
- tensorflow.keras.Model #类
- tensorflow.keras.Model.compile()
- tensorflow.keras.Model.fit()
- tensorflow.keras.Model.get_layer()
- tensorflow.keras.Model.load_weights()
- tensorflow.keras.Model.save_weights()
- tensorflow.keras.Model.trainable_variables
- tensorflow.keras.optimizers
- tensorflow.keras.optimizers.Adam() #类
- tensorflow.keras.optimizers.RMSprop
- tensorflow.keras.preprocessing
- tensorflow.keras.preprocessing.image
- tensorflow.keras.preprocessing.image.array_to_img
- tensorflow.keras.preprocessing.image.ImageDataGenerator()
- tensorflow.keras.regularizers.l2
- tensorflow.linalg
- tensorflow.linalg.adjoint
- tensorflow.linalg.band_part
- tensorflow.linalg.cholesky
- tensorflow.linalg.cholesky_solve
- tensorflow.linalg.cross
- tensorflow.linalg.det
- tensorflow.linalg.diag
- tensorflow.linalg.diag_part
- tensorflow.linalg.eigh
- tensorflow.linalg.eigvalsh
- tensorflow.linalg.einsum
- tensorflow.linalg.expm
- tensorflow.linalg.eye
- tensorflow.linalg.global_norm
- tensorflow.linalg.inv
- tensorflow.linalg.l2_normalize
- tensorflow.linalg.logdet
- tensorflow.linalg.logm
- tensorflow.linalg.lstsq
- tensorflow.linalg.lu
- tensorflow.linalg.matmul
- tensorflow.linalg.matrix_transpose
- tensorflow.linalg.matvec
- tensorflow.linalg.norm
- tensorflow.linalg.normalize
- tensorflow.linalg.qr
- tensorflow.linalg.set_diag
- tensorflow.linalg.slogdet
- tensorflow.linalg.solve
- tensorflow.linalg.sqrtm
- tensorflow.linalg.svd
- tensorflow.linalg.tensor_diag
- tensorflow.linalg.tensor_diag_part
- tensorflow.linalg.tensordot
- tensorflow.linalg.trace
- tensorflow.linalg.triangular_solve
- tensorflow.linalg.tensordot
- tensorflow.linalg.trace
- tensorflow.linalg.triangular_solve
- tensorflow.linalg.tridiagonal_matmul
- tensorflow.linalg.tridiagonal_solve
- tensorflow.lite
- tensorflow.lite.TFLiteConverter
- tensorflow.lite.TFLiteConverter.from_keras_model
- tensorflow.lite.Interpreter
- tensorflow.logical_and()
- tensorflow.lookup
- tensorflow.lookup.StaticHashTable() #类
- tensorflow.lookup.TextFileInitializer() #类
- tensorflow.lookup.TextFileIndex.LINE_NUMBER
- tensorflow.losses
- tensorflow.losses.binary_crossentropy
- tensorflow.losses.BinaryCrossentropy
- tensorflow.losses.categorical_crossentropy
- tensorflow.losses.categorical_hinge
- tensorflow.losses.cosine_similarity
- tensorflow.losses.CategoricalCrossentropy
- tensorflow.losses.CategoricalHinge
- tensorflow.losses.CosineSimilarity
- tensorflow.losses.deserialize
- tensorflow.losses.get
- tensorflow.losses.hinge
- tensorflow.losses.Hinge
- tensorflow.losses.Huber
- tensorflow.losses.kld
- tensorflow.losses.kullback_leibler_divergence
- tensorflow.losses.KLD
- tensorflow.losses.KLDivergence
- tensorflow.losses.logcosh
- tensorflow.losses.LogCosh
- tensorflow.losses.Loss
- tensorflow.losses.mae
- tensorflow.losses.mape
- tensorflow.losses.mean_absolute_error
- tensorflow.losses.mean_absolute_percentage_error
- tensorflow.losses.mean_squared_error
- tensorflow.losses.mean_squared_logarithmic_error
- tensorflow.losses.mse
- tensorflow.losses.msle
- tensorflow.losses.MAE
- tensorflow.losses.MAPE
- tensorflow.losses.MeanAbsoluteError
- tensorflow.losses.MeanAbsolutePercentageError
- tensorflow.losses.MeanSquaredError
- tensorflow.losses.MeanSquaredLogarithmicError
- tensorflow.losses.MSE
- tensorflow.losses.MSLE
- tensorflow.losses.poisson
- tensorflow.losses.Poisson
- tensorflow.losses.Reduction
- tensorflow.losses.serialize
- tensorflow.losses.sparse_categorical_crossentropy
- tensorflow.losses.squared_hinge
- tensorflow.losses.SparseCategoricalCrossentropy
- tensorflow.losses.SquaredHinge
- tensorflow.map_fn()
- tensorflow.math
- tensorflow.math.abs
- tensorflow.math.accumulate_n
- tensorflow.math.acos
- tensorflow.math.acosh
- tensorflow.math.add
- tensorflow.math.add_n
- tensorflow.math.angle
- tensorflow.math.argmax
- tensorflow.math.asin
- tensorflow.math.asinh
- tensorflow.math.atan
- tensorflow.math.atan2
- tensorflow.math.atanh
- tensorflow.math.bessel_i0
- tensorflow.math.bessel_i0e
- tensorflow.math.ceil
- tensorflow.math.confusion_matrix
- tensorflow.math.conj
- tensorflow.math.cos
- tensorflow.math.cosh
- tensorflow.math.count_nonzero
- tensorflow.math.cumprod
- tensorflow.math.cumsum
- tensorflow.math.cumulative_logsumexp
- tensorflow.math.digamma
- tensorflow.math.divide
- tensorflow.math.divide_no_nan
- tensorflow.math.equal
- tensorflow.math.erf
- tensorflow.math.erfc
- tensorflow.math.exp
- tensorflow.math.expm1
- tensorflow.math.floor
- tensorflow.math.floordiv
- tensorflow.math.floormod
- tensorflow.math.greater
- tensorflow.math.greater_equal
- tensorflow.math.igamma
- tensorflow.math.igammac
- tensorflow.math.imag
- tensorflow.math.in_top_k
- tensorflow.math.invert_permutation
- tensorflow.math.is_finite
- tensorflow.math.is_inf
- tensorflow.math.is_nan
- tensorflow.math.is_non_decreasing
- tensorflow.math.is_strictly_increasing
- tensorflow.math.l2_normalize
- tensorflow.math.lbeta
- tensorflow.math.less
- tensorflow.math.less_equal
- tensorflow.math.lgamma
- tensorflow.math.log
- tensorflow.math.log1p
- tensorflow.math.log_sigmoid
- tensorflow.math.log_softmax
- tensorflow.math.logical_and
- tensorflow.math.logical_not
- tensorflow.math.logical_or
- tensorflow.math.logical_xor
- tensorflow.math.maximum
- tensorflow.math.minimum
- tensorflow.math.mod
- tensorflow.math.multiply
- tensorflow.math.multiply_no_nan
- tensorflow.math.negative
- tensorflow.math.nextafter
- tensorflow.math.not_equal
- tensorflow.math.polygamma
- tensorflow.math.polyval
- tensorflow.math.pow
- tensorflow.math.real
- tensorflow.math.reciprocal
- tensorflow.math.reciprocal_no_nan
- tensorflow.math.reduce_all
- tensorflow.math.reduce_any
- tensorflow.math.reduce_euclidean_norm
- tensorflow.math.reduce_logsumexp
- tensorflow.math.reduce_max
- tensorflow.math.reduce_mean
- tensorflow.math.reduce_min
- tensorflow.math.reduce_prod
- tensorflow.math.reduce_std
- tensorflow.math.reduce_sum
- tensorflow.math.reduce_variance
- tensorflow.math.rint
- tensorflow.math.round
- tensorflow.math.rsqrt
- tensorflow.math.scalar_mul
- tensorflow.math.segment_max
- tensorflow.math.segment_mean
- tensorflow.math.segment_min
- tensorflow.math.segment_prod
- tensorflow.math.segment_sum
- tensorflow.math.sigmoid
- tensorflow.math.sign
- tensorflow.math.sin
- tensorflow.math.sinh
- tensorflow.math.softmax
- tensorflow.math.softplus
- tensorflow.math.softsign
- tensorflow.math.sqrt
- tensorflow.math.squared_difference
- tensorflow.math.subtract
- tensorflow.math.tan
- tensorflow.math.tanh
- tensorflow.math.top_k
- tensorflow.math.truediv
- tensorflow.math.unsorted_segment_max
- tensorflow.math.unsorted_segment_mean
- tensorflow.math.unsorted_segment_min
- tensorflow.math.unsorted_segment_prod
- tensorflow.math.unsorted_segment_sqrt_n
- tensorflow.math.unsorted_segment_sum
- tensorflow.math.xdivy
- tensorflow.math.xlogy
- tensorflow.math.zero_fraction
- tensorflow.math.zeta
- tensorflow.maximum()
- tensorflow.meshgrid()
- tensorflow.metrics
- tensorflow.metrics.binary_accuracy
- tensorflow.metrics.binary_crossentropy
- tensorflow.metrics.categorical_accuracy
- tensorflow.metrics.categorical_crossentropy
- tensorflow.metrics.deserialize
- tensorflow.metrics.get
- tensorflow.metrics.hinge
- tensorflow.metrics.kld
- tensorflow.metrics.kullback_leibler_divergence
- tensorflow.metrics.LogCoshError
- tensorflow.metrics.mae
- tensorflow.metrics.mape
- tensorflow.metrics.mean_absolute_error
- tensorflow.metrics.mean_absolute_percentage_error
- tensorflow.metrics.mean_squared_error
- tensorflow.metrics.mean_squared_logarithmic_error
- tensorflow.metrics.mse
- tensorflow.metrics.msle
- tensorflow.metrics.MAE
- tensorflow.metrics.MAPE
- tensorflow.metrics.Mean
- tensorflow.metrics.MeanAbsoluteError
- tensorflow.metrics.MeanAbsolutePercentageError
- tensorflow.metrics.MeanIoU
- tensorflow.metrics.MeanRelativeError
- tensorflow.metrics.MeanSquaredError
- tensorflow.metrics.MeanSquaredLogarithmicError
- tensorflow.metrics.MeanTensor
- tensorflow.metrics.Metric
- tensorflow.metrics.MSE
- tensorflow.metrics.MSLE
- tensorflow.metrics.poisson
- tensorflow.metrics.Poisson
- tensorflow.metrics.Precision
- tensorflow.metrics.serialize
- tensorflow.metrics.sparse_categorical_accuracy
- tensorflow.metrics.sparse_categorical_crossentropy
- tensorflow.metrics.sparse_top_k_categorical_accuracy
- tensorflow.metrics.squared_hinge
- tensorflow.metrics.SensitivityAtSpecificity
- tensorflow.metrics.SparseCategoricalAccuracy
- tensorflow.metrics.SparseCategoricalCrossentropy
- tensorflow.metrics.SparseTopKCategoricalAccuracy
- tensorflow.metrics.SparseTopKCategoricalAccuracy
- tensorflow.metrics.SpecificityAtSensitivity
- tensorflow.metrics.SquaredHinge
- tensorflow.metrics.Sum
- tensorflow.metrics.top_k_categorical_accuracy
- tensorflow.metrics.TopKCategoricalAccuracy
- tensorflow.metrics.TrueNegatives
- tensorflow.metrics.TruePositives
- tensorflow.minimum()
- tensorflow.nest
- tensorflow.nn
- tensorflow.nn.all_candidate_sampler
- tensorflow.nn.atrous_conv2d
- tensorflow.nn.atrous_conv2d_transpose
- tensorflow.nn.avg_pool
- tensorflow.nn.avg_pool1d
- tensorflow.nn.avg_pool2d
- tensorflow.nn.avg_pool3d
- tensorflow.nn.batch_norm_with_global_normalization
- tensorflow.nn.batch_normalization
- tensorflow.nn.bias_add
- tensorflow.nn.collapse_repeated
- tensorflow.nn.compute_accidental_hits
- tensorflow.nn.compute_average_loss
- tensorflow.nn.conv1d
- tensorflow.nn.conv1d_transpose
- tensorflow.nn.conv2d
- tensorflow.nn.conv2d_transpose
- tensorflow.nn.conv3d
- tensorflow.nn.conv3d_transpose
- tensorflow.nn.conv_transpose
- tensorflow.nn.convolution
- tensorflow.nn.crelu
- tensorflow.nn.ctc_beam_search_decoder
- tensorflow.nn.ctc_greedy_decoder
- tensorflow.nn.ctc_loss
- tensorflow.nn.ctc_unique_labels
- tensorflow.nn.depth_to_space
- tensorflow.nn.depthwise_conv2d
- tensorflow.nn.depthwise_conv2d_backprop_filter
- tensorflow.nn.depthwise_conv2d_backprop_input
- tensorflow.nn.dilation2d
- tensorflow.nn.dropout
- tensorflow.nn.elu
- tensorflow.nn.embedding_lookup
- tensorflow.nn.embedding_lookup_sparse
- tensorflow.nn.erosion2d
- tensorflow.nn.fixed_unigram_candidate_sampler
- tensorflow.nn.fractional_avg_pool
- tensorflow.nn.fractional_max_pool
- tensorflow.nn.in_top_k
- tensorflow.nn.l2_loss
- tensorflow.nn.l2_normalize
- tensorflow.nn.leaky_relu
- tensorflow.nn.learned_unigram_candidate_sampler
- tensorflow.nn.local_response_normalization
- tensorflow.nn.log_poisson_loss
- tensorflow.nn.log_softmax
- tensorflow.nn.lrn
- tensorflow.nn.max_pool
- tensorflow.nn.max_pool1d
- tensorflow.nn.max_pool2d
- tensorflow.nn.max_pool3d
- tensorflow.nn.max_pool_with_argmax
- tensorflow.nn.moments
- tensorflow.nn.nce_loss
- tensorflow.nn.normalize_moments
- tensorflow.nn.pool
- tensorflow.nn.relu
- tensorflow.nn.relu6
- tensorflow.nn.safe_embedding_lookup_sparse
- tensorflow.nn.sampled_softmax_loss
- tensorflow.nn.scale_regularization_loss
- tensorflow.nn.selu
- tensorflow.nn.separable_conv2d
- tensorflow.nn.sigmoid
- tensorflow.nn.sigmoid_cross_entropy_with_logits
- tensorflow.nn.softmax
- tensorflow.nn.softmax_cross_entropy_with_logits
- tensorflow.nn.softplus
- tensorflow.nn.softsign
- tensorflow.nn.space_to_batch
- tensorflow.nn.space_to_depth
- tensorflow.nn.sparse_softmax_cross_entropy_with_logits
- tensorflow.nn.sufficient_statistics
- tensorflow.nn.swish
- tensorflow.nn.tanh
- tensorflow.nn.top_k
- tensorflow.nn.weighted_cross_entropy_with_logits
- tensorflow.nn.weighted_moment
- tensorflow.nn.with_space_to_batch
- tensorflow.nn.zero_fraction
- tensorflow.optimizers
- tensorflow.optimizers.RMSprop
- tensorflow.optimizers.Adadelta
- tensorflow.optimizers.Adagrad
- tensorflow.optimizers.Adam
- tensorflow.optimizers.Adamax
- tensorflow.optimizers.deserialize
- tensorflow.optimizers.Ftrl
- tensorflow.optimizers.get
- tensorflow.optimizers.Nadam
- tensorflow.optimizers.Optimizer
- tensorflow.optimizers.RMSprop
- tensorflow.optimizers.schedules
- tensorflow.optimizers.SGD
- tensorflow.pad()
- tensorflow.plugin_dir
- tensorflow.print()
- tensorflow.python
- tensorflow.python.eager
- tensorflow.python.eager.def_function
- tensorflow.python.framework
- tensorflow.python.framework.tensor_spec
- tensorflow.python.autograph
- tensorflow.python.client
- tensorflow.python.compat
- tensorflow.python.compiler
- tensorflow.python.ctypes
- tensorflow.python.data
- tensorflow.python.debug
- tensorflow.python.distribute
- tensorflow.python.estimator
- tensorflow.python.feature_column
- tensorflow.python.framework
- tensorflow.python.grappler
- tensorflow.python.importlib
- tensorflow.python.keras
- tensorflow.python.kernel_tests
- tensorflow.python.layers
- tensorflow.python.lib
- tensorflow.python.module
- tensorflow.python.np
- tensorflow.python.ops
- tensorflow.python.ops.array_grad
- tensorflow.python.ops.array_ops
- tensorflow.python.ops.batch_ops
- tensorflow.python.ops.bitwise_ops
- tensorflow.python.ops.boosted_trees_ops
- tensorflow.python.ops.candidate_sampling_ops
- tensorflow.python.ops.check_ops
- tensorflow.python.ops.clip_ops
- tensorflow.python.ops.clustering_ops
- tensorflow.python.ops.collective_ops
- tensorflow.python.ops.cond_v2
- tensorflow.python.ops.confusion_matrix
- tensorflow.python.ops.control_flow_grad
- tensorflow.python.ops.control_flow_ops
- tensorflow.python.ops.control_flow_state
- tensorflow.python.ops.control_flow_util
- tensorflow.python.ops.control_flow_util_v2
- tensorflow.python.ops.control_flow_v2_func_graphs
- tensorflow.python.ops.control_flow_v2_toggles
- tensorflow.python.ops.critical_section_ops
- tensorflow.python.ops.ctc_ops
- tensorflow.python.ops.cudnn_rnn_grad
- tensorflow.python.ops.custom_gradient
- tensorflow.python.ops.data_flow_grad
- tensorflow.python.ops.data_flow_ops
- tensorflow.python.ops.default_gradient
- tensorflow.python.ops.distributions
- tensorflow.python.ops.embedding_ops
- tensorflow.python.ops.functional_ops
- tensorflow.python.ops.gen_array_ops
- tensorflow.python.ops.gen_audio_ops
- tensorflow.python.ops.gen_batch_ops
- tensorflow.python.ops.gen_bitwise_ops
- tensorflow.python.ops.gen_boosted_trees_ops
- tensorflow.python.ops.gen_candidate_sampling_ops
- tensorflow.python.ops.gen_checkpoint_ops
- tensorflow.python.ops.gen_clustering_ops
- tensorflow.python.ops.gen_collective_ops
- tensorflow.python.ops.gen_control_flow_ops
- tensorflow.python.ops.gen_ctc_ops
- tensorflow.python.ops.gen_cudnn_rnn_ops
- tensorflow.python.ops.gen_data_flow_ops
- tensorflow.python.ops.gen_dataset_ops
- tensorflow.python.ops.gen_decode_proto_ops
- tensorflow.python.ops.gen_encode_proto_ops
- tensorflow.python.ops.gen_experimental_dataset_ops
- tensorflow.python.ops.gen_functional_ops
- tensorflow.python.ops.gen_image_ops
- tensorflow.python.ops.gen_io_ops
- tensorflow.python.ops.gen_linalg_ops
- tensorflow.python.ops.gen_list_ops
- tensorflow.python.ops.gen_logging_ops
- tensorflow.python.ops.gen_lookup_ops
- tensorflow.python.ops.gen_manip_ops
- tensorflow.python.ops.gen_math_ops
- tensorflow.python.ops.gen_nccl_ops
- tensorflow.python.ops.gen_nn_ops
- tensorflow.python.ops.gen_parsing_ops
- tensorflow.python.ops.gen_ragged_array_ops
- tensorflow.python.ops.gen_ragged_conversion_ops
- tensorflow.python.ops.gen_ragged_math_ops
- tensorflow.python.ops.gen_random_ops
- tensorflow.python.ops.gen_resource_variable_ops
- tensorflow.python.ops.gen_rnn_ops
- tensorflow.python.ops.gen_script_ops
- tensorflow.python.ops.gen_sdca_ops
- tensorflow.python.ops.gen_set_ops
- tensorflow.python.ops.gen_sparse_ops
- tensorflow.python.ops.gen_spectral_ops
- tensorflow.python.ops.gen_state_ops
- tensorflow.python.ops.gen_stateful_random_ops
- tensorflow.python.ops.gen_stateless_random_ops
- tensorflow.python.ops.gen_string_ops
- tensorflow.python.ops.gen_summary_ops
- tensorflow.python.ops.gen_tensor_forest_ops
- tensorflow.python.ops.gen_tpu_ops
- tensorflow.python.ops.gen_user_ops
- tensorflow.python.ops.gradient_checker
- tensorflow.python.ops.gradient_checker_v2
- tensorflow.python.ops.gradients
- tensorflow.python.ops.gradients_impl
- tensorflow.python.ops.gradients_util
- tensorflow.python.ops.histogram_ops
- tensorflow.python.ops.image_grad
- tensorflow.python.ops.image_ops
- tensorflow.python.ops.image_ops_impl
- tensorflow.python.ops.init_ops
- tensorflow.python.ops.init_ops_v2
- tensorflow.python.ops.initializers_ns
- tensorflow.python.ops.inplace_ops
- tensorflow.python.ops.io_ops
- tensorflow.python.ops.linalg
- tensorflow.python.ops.linalg_grad
- tensorflow.python.ops.linalg_ops
- tensorflow.python.ops.linalg_ops_impl
- tensorflow.python.ops.list_ops
- tensorflow.python.ops.logging_ops
- tensorflow.python.ops.lookup_ops
- tensorflow.python.ops.losses
- tensorflow.python.ops.manip_grad
- tensorflow.python.ops.manip_ops
- tensorflow.python.ops.map_fn
- tensorflow.python.ops.math_grad
- tensorflow.python.ops.math_ops
- tensorflow.python.ops.metrics
- tensorflow.python.ops.metrics_impl
- tensorflow.python.ops.nccl_ops
- tensorflow.python.ops.nn
- tensorflow.python.ops.nn_impl
- tensorflow.python.ops.nn_ops
- tensorflow.python.ops.numerics
- tensorflow.python.ops.op_selector
- tensorflow.python.ops.optional_grad
- tensorflow.python.ops.parallel_for
- tensorflow.python.ops.parsing_ops
- tensorflow.python.ops.partitioned_variables
- tensorflow.python.ops.proto_ops
- tensorflow.python.ops.ragged
- tensorflow.python.ops.random_grad
- tensorflow.python.ops.random_ops
- tensorflow.python.ops.resource_variable_ops
- tensorflow.python.ops.resources
- tensorflow.python.ops.rnn
- tensorflow.python.ops.rnn_cell
- tensorflow.python.ops.rnn_cell_impl
- tensorflow.python.ops.rnn_cell_wrapper_impl
- tensorflow.python.ops.rnn_grad
- tensorflow.python.ops.script_ops
- tensorflow.python.ops.sdca_ops
- tensorflow.python.ops.session_ops
- tensorflow.python.ops.sets
- tensorflow.python.ops.sets_impl
- tensorflow.python.ops.signal
- tensorflow.python.ops.sort_ops
- tensorflow.python.ops.sparse_grad
- tensorflow.python.ops.sparse_ops
- tensorflow.python.ops.special_math_ops
- tensorflow.python.ops.spectral_ops_test_util
- tensorflow.python.ops.standard_ops
- tensorflow.python.ops.state_grad
- tensorflow.python.ops.state_ops
- tensorflow.python.ops.stateful_random_ops
- tensorflow.python.ops.stateless_random_ops
- tensorflow.python.ops.string_ops
- tensorflow.python.ops.template
- tensorflow.python.ops.tensor_array_grad
- tensorflow.python.ops.tensor_array_ops
- tensorflow.python.ops.tensor_forest_ops
- tensorflow.python.ops.unconnected_gradients
- tensorflow.python.ops.variable_scope
- tensorflow.python.ops.variables
- tensorflow.python.ops.weights_broadcast_ops
- tensorflow.python.ops.while_v2
- tensorflow.python.ops.while_v2_indexed_slices_rewriter
- tensorflow.python.platform
- tensorflow.python.profiler
- tensorflow.python.pywrap_dlopen_global_flags
- tensorflow.python.pywrap_tensorflow
- tensorflow.python.pywrap_tensorflow_internal
- tensorflow.python.saved_model
- tensorflow.python.summary
- tensorflow.python.sys
- tensorflow.python.tf2
- tensorflow.python.tools
- tensorflow.python.tpu
- tensorflow.python.traceback
- tensorflow.python.training
- tensorflow.python.user_ops
- tensorflow.python.util
- tensorflow.python.util.nest
- tensorflow.quantization
- tensorflow.queue
- tensorflow.ragged
- tensorflow.random
- tensorflow.random.all_candidate_sampler
- tensorflow.random.experimental
- tensorflow.random.categorical
- tensorflow.random.fixed_unigram_candidate_sampler
- tensorflow.random.gamma
- tensorflow.random.learned_unigram_candidate_sampler
- tensorflow.random.log_uniform_candidate_sampler
- tensorflow.random.normal
- tensorflow.random.poisson
- tensorflow.random.set_seed
- tensorflow.random.shuffle
- tensorflow.random.stateless_categorical
- tensorflow.random.stateless_normal
- tensorflow.random.stateless_truncated_normal
- tensorflow.random.stateless_uniform
- tensorflow.random.truncated_normal
- tensorflow.random.uniform()
- tensorflow.random.uniform_candidate_sampler
- tensorflow.range()
- tensorflow.raw_ops
- tensorflow.reduce_any()
- tensorflow.reduce_sum()
- tensorflow.reduce_max()
- tensorflow.reshape()
- tensorflow.s
- tensorflow.saved_model
- tensorflow.saved_model.save()
- tensorflow.saved_model.load()
- tensorflow.sets
- tensorflow.shape()
- tensorflow.signal
- tensorflow.sparse
- tensorflow.sparse.to_dense()
- tensorflow.split()
- tensorflow.square()
- tensorflow.squeeze()
- tensorflow.string
- tensorflow.strings.as_string
- tensorflow.strings.bytes_split
- tensorflow.strings.format
- tensorflow.strings.join
- tensorflow.strings.length
- tensorflow.strings.lower
- tensorflow.strings.ngrams
- tensorflow.strings.reduce_join
- tensorflow.strings.regex_full_match
- tensorflow.strings.regex_replace()
- tensorflow.strings.split
- tensorflow.strings.strip
- tensorflow.strings.substr
- tensorflow.strings.to_hash_bucket
- tensorflow.strings.to_hash_bucket_fast
- tensorflow.strings.to_hash_bucket_strong
- tensorflow.strings.to_number
- tensorflow.strings.unicode_decode
- tensorflow.strings.unicode_decode_with_offsets
- tensorflow.strings.unicode_encode
- tensorflow.strings.unicode_script
- tensorflow.strings.unicode_split
- tensorflow.strings.unicode_split_with_offsets
- tensorflow.strings.unicode_transcode
- tensorflow.strings.unsorted_segment_join
- tensorflow.strings.upper
- tensorflow.stack()
- tensorflow.summary
- tensorflow.summary.absolute_import
- tensorflow.summary.audio()
- tensorflow.summary.division
- tensorflow.summary.histogram()
- tensorflow.summary.image()
- tensorflow.summary.print_function
- tensorflow.summary.reexport_tf_summary()
- tensorflow.summary.scalar()
- tensorflow.summary.text()
- tensorflow.summary.tf
- tensorflow.summary.tf.audio
- tensorflow.summary.tf.autograph
- tensorflow.summary.tf.bitwise
- tensorflow.summary.tf.compat
- tensorflow.summary.tf.compiler
- tensorflow.summary.tf.config
- tensorflow.summary.tf.contrib
- tensorflow.summary.tf.core
- tensorflow.summary.tf.data
- tensorflow.summary.tf.debugging
- tensorflow.summary.tf.distribute
- tensorflow.summary.tf.dtypes
- tensorflow.summary.tf.errors
- tensorflow.summary.tf.estimator
- tensorflow.summary.tf.examples
- tensorflow.summary.tf.experimental
- tensorflow.summary.tf.feature_column
- tensorflow.summary.tf.graph_util
- tensorflow.summary.tf.image
- tensorflow.summary.tf.include
- tensorflow.summary.tf.initializers
- tensorflow.summary.tf.io
- tensorflow.summary.tf.keras
- tensorflow.summary.tf.linalg
- tensorflow.summary.tf.lite
- tensorflow.summary.tf.lookup
- tensorflow.summary.tf.losses
- tensorflow.summary.tf.math
- tensorflow.summary.tf.metrics
- tensorflow.summary.tf.nest
- tensorflow.summary.tf.nn
- tensorflow.summary.tf.optimizers
- tensorflow.summary.tf.plugin_dir
- tensorflow.summary.tf.python
- tensorflow.summary.tf.quantization
- tensorflow.summary.tf.queue
- tensorflow.summary.tf.ragged
- tensorflow.summary.tf.random
- tensorflow.summary.tf.raw_ops
- tensorflow.summary.tf.s
- tensorflow.summary.tf.saved_model
- tensorflow.summary.tf.sets
- tensorflow.summary.tf.signal
- tensorflow.summary.tf.sparse
- tensorflow.summary.tf.strings
- tensorflow.summary.tf.summary
- tensorflow.summary.tf.sysconfig
- tensorflow.summary.tf.test
- tensorflow.summary.tf.tools
- tensorflow.summary.tf.tpu
- tensorflow.summary.tf.train
- tensorflow.summary.tf.version
- tensorflow.summary.tf.xla
- tensorflow.sysconfig
- tensorflow.sysconfig.CXX11_ABI_FLAG
- tensorflow.sysconfig.get_compile_flags
- tensorflow.sysconfig.get_include
- tensorflow.sysconfig.get_lib
- tensorflow.sysconfig.get_link_flags
- tensorflow.sysconfig.MONOLITHIC_BUILD
- tensorflow.tensor_scatter_nd_update()
- tensorflow.test.assert_equal_graph_def
- tensorflow.test.benchmark_config
- tensorflow.test.compute_gradient
- tensorflow.test.create_local_cluster
- tensorflow.test.gpu_device_name
- tensorflow.test.is_built_with_cuda
- tensorflow.test.is_built_with_gpu_support
- tensorflow.test.is_built_with_rocm
- tensorflow.test.is_gpu_available
- tensorflow.test.main
- tensorflow.TensorArray()
- tensorflow.tile()
- tensorflow.tools
- tensorflow.tools.common
- tensorflow.tools.compatibility
- tensorflow.tools.docs
- tensorflow.tools.pip_package
- tensorflow.tpu
- tensorflow.train
- tensorflow.train.BytesList()
- tensorflow.train.checkpoints_iterator
- tensorflow.train.Checkpoint
- tensorflow.train.CheckpointManager
- tensorflow.train.ClusterDef
- tensorflow.train.ClusterSpec
- tensorflow.train.Coordinator
- tensorflow.train.experimental
- tensorflow.train.Example
- tensorflow.train.ExponentialMovingAverage
- tensorflow.train.Feature
- tensorflow.train.FeatureList
- tensorflow.train.FeatureLists
- tensorflow.train.Features
- tensorflow.train.FloatList
- tensorflow.train.get_checkpoint_state
- tensorflow.train.Int64List
- tensorflow.train.JobDef
- tensorflow.train.latest_checkpoint
- tensorflow.train.list_variables
- tensorflow.train.load_checkpoint
- tensorflow.train.load_variable
- tensorflow.train.SequenceExample
- tensorflow.train.ServerDef
- tensorflow.version
- tensorflow.where
- tensorflow.while_loop
- tensorflow.xla
- tensorflow.zeros()
- tensorflow.zeros_like()
前言
原文是转自知乎极相 空林玄一的文章。在她的基础上,我会尽可能的对每个函数的功能进行说明。文档会长期进行编辑,直到完全补全为止。网上的tf2.0的官方文档,或者中文系统资料大多数是从功能和使用的角度进行排序的。可能并不是方便查阅。本文只对函数的作用和功能以及使用方法进行介绍,不涉及原理,只是方便有需求者进行查阅。如有需求请移步官方文档。
import tensorflow
print(tensorflow.version)
(目前还不全,还在测试学习中,会陆续更新,争取5月以前搞定。。。)
tensorflow.audio
音频的处理模块。
tensorflow.audio.decode_wav
用于音频的解码,解码的文件要求是16进制
tf.audio.decode_wav(
contents,
desired_channels=-1,
desired_samples=-1,
name=None
)
# content 是一个张量,是读取一个wav格式的音频文件后,储存成张量的形式
# desired_channels 是想要的音频文件的通道数
# desired_samples 是想要的音频文件的采样数(长度)
测试实例
import tensorflow as tf
import tensorflow.compat.v1 as tf1
import wave
import numpy as np
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "2"
tf1.disable_eager_execution()
# np.set_printoptions(threshold=np.inf)
f = wave.open(r"D:\gongyong\csdn\Heaven.wav","rb")
params = f.getparams()
nchannels, sampwidth, framerate, nframes = params[:4]
#读取波形数据
#读取声音数据,传递一个参数指定需要读取的长度(以取样点为单位)
str_data = f.readframes(nframes)
print(f)
print(params)
print(str_data)
f.close()
#将波形数据转换成数组
#需要根据声道数和量化单位,将读取的二进制数据转换为一个可以计算的数组
wave_data = np.frombuffer(str_data,dtype = np.short)
wave_data_list = list(wave_data)
print(len(wave_data_list))
wave_data = np.delete(wave_data,wave_data_list[39571796])
print(type(wave_data))
#将wave_data数组改为2列,行数自动匹配。在修改shape的属性时,需使得数组的总长度不变。
wave_data.shape = -1,2
wave_data = wave_data.T
wave_data = wave_data.astype(np.float32, order='C')/ 32768.0
wave_data_a = str(wave_data)
tensor_a=tf.convert_to_tensor(wave_data_a)
print(tensor_a)
m = tf.audio.decode_wav(
tensor_a,
desired_channels=-1,
desired_samples=-1,
name=None
)
print(m)
测试结果
[ 2611 -18432 5 ... 0 0 0]
Tensor("Const:0", shape=(), dtype=string)
DecodeWav(audio=<tf.Tensor 'DecodeWav:0' shape=(None, None) dtype=float32>, sample_rate=<tf.Tensor 'DecodeWav:1' shape=() dtype=int32>)
这里面wave_data必须经过str转化。
否则会报错。而wave_data提取出来是一维的ndarray的格式。
调试过程中的另一个问题,因为我使用的音频是一个双通道的音乐,因此读取完以后需要转换成两列。结果报错了,错误内容见下贴。
ValueError: cannot reshape array of size 39571797 into shape (2,newaxis)
tensorflow.audio.encode_wav
用于音频的编码,要求输入的张量为 float.32
tf.audio.encode_wav(
audio,
sample_rate,
name=None
)
# audio 为一个张量,是被编码的数据
# sample_rate 为采样率,一个数字
和decode完全就是互逆的过程!一定要注意输入的audio的格式!!!!!!
测试代码,接上个decode的。我用上一个decode的输出输入到这个里面,测试结果如下:
m1 , sample_rate_decode = m
print(m1,sample_rate_decode )
Heaven = tf.audio.encode_wav(
m1,
sample_rate_decode,
name=None
)
print("encode:",Heaven)
这是输入的两个tensor,第一个是audio,第二个则是采样率
Tensor("Const_1:0", shape=(2, 19785898), dtype=float32)
Tensor("Const_2:0", shape=(1,), dtype=int32)
这是输出的结果。
encode: Tensor("EncodeWav:0", shape=(), dtype=string)
音频的编码和解码一定要注意输入数据的格式,不然很容易出错。
避免出错的很重要的一点就是保证使用的音频文件编码和解码过程中每一步的数据的类型。
tensorflow.autograph
将普通Python转换为TensorFlow图形代码。
等效图形代码是指在运行时生成TensorFlow图形的代码。执行后,生成的图形与原始代码具有相同的效果(例如,使用tf.function或tf.compat.v1.Session.run)。换句话说,可以将使用AutoGraph视为在TensorFlow中运行Python。
tensorflow.autograph.experimental
tensorflow.autograph.experimental.do_not_convert()
tensorflow.autograph.experimental.set_loop_options()
tensorflow.autograph.set_verbosity()
tensorflow.argmax()
tf.argmax(input,axis)根据axis取值的不同返回每行或者每列最大值的索引。
https://blog.csdn.net/qq_35535616/article/details/111139044
tensorflow.batch_to_space
tensorflow.bfloat16
tensorflow.bitcast
tensorflow.bitwise
tensorflow.bool
tensorflow.boolean_mask
tensorflow.cast()
tensorflow.compat
tensorflow.compiler
tensorflow.concat()
tensorflow.constant()
tensorflow.config
tensorflow.config.experimental
tensorflow.config.experimental.list_physical_devices()
tensorflow.config.experimental.set_memory_growth()
tensorflow.contrib
tensorflow.convert_to_tensor()
tensorflow.core
tensorflow.core.debug
tensorflow.core.example
tensorflow.core.framework
tensorflow.core.grappler
tensorflow.core.kernels
tensorflow.core.lib
tensorflow.core.profiler
tensorflow.core.protobuf
tensorflow.core.util
tensorflow.core.util.event_pb2
tensorflow.core.util.memmapped_file_system_pb2
tensorflow.core.util.saved_tensor_slice_pb2
tensorflow.core.util.test_log_pb2
tensorflow.data
用于数据读取管道搭建
tensorflow.data.Dataset
用于读取数据,做预处理,调整batch和epoch等操作
tensorflow.data.Dataset.from_tensor_slices()
用于加载数据集(数据集的建立).
dataset = tf.data.Dataset.from_tensor_slices((data,label))
print(dataset)
#其中data是需要用的数据集的路径集合,label对应的是每一个数据的标签
输入的data为文件路径或者文件路径列表,label为一个一维数组
输入的data和label的形式如下,输出的结果也如下:
data = ['D:\\gongyong\\tensor\\test\\test\\03F4C4D9.wav', 'D:\\gongyong\\tensor\\test\\test\\03F75380.wav',
...
'D:\\gongyong\\tensor\\test\\test\\04CDD959.wav', 'D:\\gongyong\\tensor\\test\\test\\04D11CE5.wav']
label = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
# 这里为了省事我就把label都赋值成0,一共200个wav音频数据
dataset = <TensorSliceDataset shapes: ((), ()), types: (tf.string, tf.int32)>
#输出的dataset为一个可以用于训练的张量,注意张量的数据类型
tensorflow.data.Dataset.list_files()
输入同tf.data.Dataset.from_tensor_slices的data,是文件路径或者文件路径列表
输出结果返回文件路径列表的dataset形式
datasets = tf.data.Dataset.list_files(data)
print(datasets)
结果:
<ShuffleDataset shapes: (), types: tf.string>
tensorflow.data.Dataset.from_tensor_slices()
tensorflow.data.Dataset.list_files()
测试代码:
import tensorflow as tf
import tensorflow.compat.v1 as tf1
import os
tf1.disable_eager_execution()
file_path = r'D:\tensor\test\test'
data = [os.path.join(file_path,i) for i in os.listdir(file_path)]
label = [0]*len(data)
print(data)
print(label)
print(len(label))
dataset = tf1.data.Dataset.from_tensor_slices((data,label))
datasets = tf1.data.Dataset.list_files(data)
iterator = dataset.make_one_shot_iterator()
one_element = iterator.get_next()
iterators = dataset.make_one_shot_iterator()
one_elements = iterators.get_next()
print(dataset)
print(datasets)
with tf1.Session() as sess:
for i in range(5):
print("s1:",sess.run(one_element))
for i in range(5):
print("s2:",sess.run(one_elements))
测试结果:
这里只测试查看前五个。
<DatasetV1Adapter shapes: ((), ()), types: (tf.string, tf.int32)>
<DatasetV1Adapter shapes: (), types: tf.string>
s1: (b'D:\\tensor\\test\\test\\03F4C4D9.wav', 0)
s1: (b'D:\\tensor\\test\\test\\03F75380.wav', 0)
s1: (b'D:\\tensor\\test\\test\\03F8594B.wav', 0)
s1: (b'D:\\tensor\\test\\test\\03FAA931.wav', 0)
s1: (b'D:\\tensor\\test\\test\\03FCB6E5.wav', 0)
s2: (b'D:\\tensor\\test\\test\\03F4C4D9.wav', 0)
s2: (b'D:\\tensor\\test\\test\\03F75380.wav', 0)
s2: (b'D:\\tensor\\test\\test\\03F8594B.wav', 0)
s2: (b'D:\\tensor\\test\\test\\03FAA931.wav', 0)
s2: (b'D:\\tensor\\test\\test\\03FCB6E5.wav', 0)
这里我文件夹里面存放的文件是一组200个的音频文件,测试需要重新拼接目录
tensorflow.data.Dataset.list_files.flat_map()
对集合中每个元素运用某个函数操作(每个元素会被映射为0到多个输出元素)后,将结果扁平化组成一个新的集合。
tensorflow.data.TFRecordDataset
tensorflow.data.experimental.AUTOTUNE
tensorflow.data.Iterator
它表示了一个tf.data.Dataset的迭代器
tensorflow.debugging
tensorflow.distribute
tensorflow.distribute.OneDeviceStrategy()
tensorflow.dtypes
tensorflow.equal()
判断,x, y 是不是相等,它的判断方法不是整体判断;
而是逐个元素进行判断,如果相等就是True,不相等,就是False;
import tensorflow.compat.v1 as tf
a = [[1,1,1],[2,5,2]]
b = [[1,0,1],[1,5,1]]
with tf.Session() as sess:
print(sess.run(tf.equal(a,b)))
结果:
[[ True False True]
[False True False]]