Energy-based Models -- Hopfield Network
Hao Dong
Peking University
1 Contents
• Discrete Hopfield Neural Networks • Introduction • How to use • How to train • Thinking • Continuous Hopfield Neural Networks
2 • Discrete Hopfield Neural Networks • Introduction • How to use • How to train • Thinking • Continuous Hopfield Neural Networks
3 • Before
All feed forward structures
• What about …
4 Consider this network
+1 �� � ≥ 0 � � = −1 �� � < 0
� = �( � � + � )
• The output of each neuron is +1/-1 • Every neuron receives input from every other neuron • Every neuron outputs signals to every other neuron • The weight is symmetric: � = � assume �!! = 0
5 Hopfield Net
+1 �� � ≥ 0 � � = −1 �� � < 0
� = �( � � + � )
• At each time, each neuron receives a “field”: ∑ � � + � • If the sign of the field matches its own sign, nothing happens; • If the sign of the field opposes its own sign, it “flips” to match the sign of the field.
� → −� , �� � � � + � < 0 6 Hopfield Net
+1 �� � ≥ 0 � � = −1 �� � < 0
� = �( � � + � ) • If the sign of the field opposes its own sign, it “flips” to match the sign of the field. • “Flips” of a neuron may cause other neurons to “flip”!
� → −� , �� � � � + � < 0 7 Example
• Red edges are +1, blue edges are -1 • Yellow nodes are -1, black nodes are +1
8 Example
• Red edges are +1, blue edges are -1 • Yellow nodes are -1, black nodes are +1
9 Example
• Red edges are +1, blue edges are -1 • Yellow nodes are -1, black nodes are +1
10 Example
• Red edges are +1, blue edges are -1 • Yellow nodes are -1, black nodes are +1
11 Hopfield Net
• If the sign of the field opposes its own sign, it “flips” to match the field • Which will change the field at other nodes • Which may then flip • Which may cause other neurons to flip • And so on… • Will this continue forever?
12 Hopfield Net
+1 �� � ≥ 0 � � = −1 �� � < 0
� = �( � � + � )