keras tensor基本操作

2019-06-23  本文已影响0人  carry_xz

tensor操作

reshape

keras.backend.reshape(x,shape)
Arguments

permute_dimensions

keras.backend.permute_dimensions(x,pattern)
Arguments

resize_images

keras.backend.resize_images(x, height_factor, width_factor, data_format, interpolation='nearest')

Resizes the images contained in a 4D tensor.

Arguments

resize_volumes

keras.backend.resize_volumes(x, depth_factor, height_factor, width_factor, data_format)

Resizes the volume contained in a 5D tensor.

Arguments

arange

keras.backend.arange(start, stop=None, step=1, dtype='int32')

Creates a 1D tensor containing a sequence of integers.

Arguments

tile

keras.backend.tile(x, n)

Creates a tensor by tiling x by n.return a tiled tensor .网格化tensor,像瓷砖一样铺展开来,类似于repeat复制

Arguments

batch_flatten

keras.backend.batch_flatten(x)

Turn a nD tensor into a 2D tensor with same 0th dimension.
In other words, it flattens each data samples of a batch.按batch展开tensor。

expand_dims

keras.backend.expand_dims(x, axis=-1)

在指定的轴上进行维度拓展

Arguments

squeeze

keras.backend.squeeze(x,axis)

Removes a 1-dimension from the tensor at index "axis".
降低指定轴上的维度

cast

keras.backend.cast(x, dtype)

Casts a tensor to a different dtype and returns it.
You can cast a Keras variable but it still returns a Keras tensor.
数据类型转化

上一篇 下一篇

猜你喜欢

热点阅读