Keras: Variable length in output of lambda layer

Created on 7 Dec 2017  路  2Comments  路  Source: rstudio/keras

Hey, I have a Lambda layer, which changes the Dimension of the Input, depending on the Input. So I want to declare the Output shape of the Lambda layer with a "None", what is the correct way to do that in R?
l=layer_lambda(input,f,output_shape = c(1,None,1))
this doesnt work and using NULL doesnt work either.

Most helpful comment

If you include a NULL you need to put it in a list(), e.g. output_shape = list(1,NULL,1). This is because R removes NULL values passed to the c() function.

All 2 comments

If you include a NULL you need to put it in a list(), e.g. output_shape = list(1,NULL,1). This is because R removes NULL values passed to the c() function.

Oh my god that helped me so much ! thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

saanasum picture saanasum  路  4Comments

mattwarkentin picture mattwarkentin  路  3Comments

qade544 picture qade544  路  5Comments

LarsHill picture LarsHill  路  6Comments

gundalav picture gundalav  路  3Comments