Custom layers in Keras -- custom weights

I am trying to understand how to build custom layers in Keras and I went through a couple examples: here and here. The syntax is, of course, similar, but in non of the cases it is addressed why weights are declared the way they are. For instance, how do I constrain weights to be binary?

Thanks in advance!

Topic weighted-data neural-network machine-learning

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.