Abstract: A method of training a hierarchical neural network in hardware comprising a plurality of neurons having tree structure connections between respective ones of the plurality of neurons to compute plausible inferences based on input data. The method includes initiating a WTA neuron ensemble to connect to data input neurons and produce a winner-take-all, attaching data records match with top neurons and branching out at WTA junctions to form a hierarchy network tree, converting a stream of the input data into neuron bipolar signals, updating neuron weights with Hebbian and anti-Hebbian rules, and repeating the attaching, converting, and updating until the input data is exhausted.