Maximal Capacity of a two-layer hierarchical neural network