Say I have a keras model (for example)
layers_NE<-keras_model_sequential()
layers_NE %>% layer_dense(units=Height,
activation = "relu",
trainable=TRUE,
input_shape = 4,
bias_initializer = "random_normal")
%>% layer_dense(units = (d^2),
activation = "linear",
trainable = TRUE,
bias_initializer = "random_normal")
I want to reshape the last layer to a skew-symmetric matrix output for example like this c(a,b,c)-> c(c(a,b),c(b,c)) (here c(a,b,c) is notation for the output of my network)
So far I've tried this:
layers_NE %>%layer_reshape(input_shape = (d^2),
target_shape = c(d,d)
)
the output is of the correct shape but it isn't symmetric. How can I make that happen?