Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AvgPool3D layer #99

Merged
merged 6 commits into from
Jun 13, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix function names
  • Loading branch information
mkaze committed Jun 10, 2021
commit 195f320013c644f187429a77abc0ca1591938988
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private fun convertToLayer(
kerasLayer.config!!,
kerasLayer.config.name!!
)
LAYER_AVG_POOL_3D -> createAvgPool3D(kerasLayer.config!!, kerasLayer.config.name!!)
LAYER_AVG_POOL_3D -> createAvgPool3DLayer(kerasLayer.config!!, kerasLayer.config.name!!)
LAYER_DENSE -> createDense(kerasLayer.config!!, kerasLayer.config.name!!)
LAYER_ZERO_PADDING_2D -> createZeroPadding2D(kerasLayer.config!!, kerasLayer.config.name!!)
LAYER_CROPPING_2D -> createCropping2D(kerasLayer.config!!, kerasLayer.config.name!!)
Expand Down Expand Up @@ -652,7 +652,7 @@ private fun createAvgPooling2D(config: LayerConfig, name: String): AvgPool2D {
return AvgPool2D(addedOnesPoolSize, addedOnesStrides, padding = convertPadding(config.padding!!), name = name)
}

private fun createAvgPool3D(config: LayerConfig, name: String): Layer {
private fun createAvgPool3DLayer(config: LayerConfig, name: String): Layer {
val poolSize = config.pool_size!!
val addedOnesPoolSize = longArrayOf(1, poolSize[0].toLong(), poolSize[1].toLong(), poolSize[2].toLong(), 1)
val strides = config.strides!!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private fun convertToKerasLayer(layer: Layer, isKerasFullyCompatible: Boolean, i
is Flatten -> createKerasFlatten(layer)
is MaxPool2D -> createKerasMaxPooling2D(layer)
is AvgPool2D -> createKerasAvgPooling2D(layer)
is AvgPool3D -> createAvgPool3D(layer)
is AvgPool3D -> createKerasAvgPool3DLayer(layer)
is Dense -> createKerasDense(layer, isKerasFullyCompatible)
is ZeroPadding2D -> createKerasZeroPadding2D(layer)
is Input -> createKerasInput(layer)
Expand Down Expand Up @@ -456,7 +456,7 @@ private fun createKerasAvgPooling2D(layer: AvgPool2D): KerasLayer {
return KerasLayer(class_name = LAYER_AVG_POOLING_2D, config = configX)
}

private fun createAvgPool3D(layer: AvgPool3D): KerasLayer {
private fun createKerasAvgPool3DLayer(layer: AvgPool3D): KerasLayer {
val strideValue = layer.strides ?: layer.poolSize
val configX = LayerConfig(
dtype = DATATYPE_FLOAT32,
Expand Down