-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New App, Simulink Models, Runge-Kutta simulation method for TSP and G…
…QKP, improved documentation, new examples, minor bugs and enhancements Bug fixing: #35 Checkpoint fails when using divide-conquer simulation method Enhancements: #10 Enable phase visualization in Divide-and-Conquer #28 Create Hopfield Network for Simulink #50 Update Hopfield Net TSP solver App #51 Runge-Kutta simulation method #52 energyplot function for HopfieldNetworkGQKP #53 Improve documentation #54 New examples for 2-opt, simulink models and GQKP Tasks: #23 TSPLIB help page not linked in User's Guide
- Loading branch information
1 parent
b383641
commit 1dbabd4
Showing
142 changed files
with
2,745 additions
and
1,166 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,20 +5,23 @@ | |
<param.email>[email protected]</param.email> | ||
<param.company>mathinking.github.com</param.company> | ||
<param.summary>A Hopfield Network Toolbox for MATLAB</param.summary> | ||
<param.description>The Hopfield Network Toolbox can solve combinatorial optimization problems by using Hopfield Neural Networks. The Hopfield Network Toolbox is focused in Continuous Hopfield Networks.</param.description> | ||
<param.description>The Hopfield Network Toolbox can solve combinatorial optimization problems by using Hopfield Neural Networks. The Hopfield Network Toolbox is mainly focused in Continuous Hopfield Networks.</param.description> | ||
<param.screenshot>${PROJECT_ROOT}\help\html\hopfieldnet.png</param.screenshot> | ||
<param.version>1.1.2</param.version> | ||
<param.version>2.0</param.version> | ||
<param.output>${PROJECT_ROOT}\Hopfield Network Toolbox.mltbx</param.output> | ||
<param.products.name> | ||
<item>MATLAB</item> | ||
<item>Simulink</item> | ||
<item>Statistics and Machine Learning Toolbox</item> | ||
</param.products.name> | ||
<param.products.id> | ||
<item>1</item> | ||
<item>2</item> | ||
<item>19</item> | ||
</param.products.id> | ||
<param.products.version> | ||
<item>9.2</item> | ||
<item>8.9</item> | ||
<item>11.1</item> | ||
</param.products.version> | ||
<param.platforms /> | ||
|
@@ -48,10 +51,16 @@ help_source/ | |
Hopfield Net TSP solver_resources/ | ||
README.md | ||
setup_hopfieldNetwork.m | ||
BuildInstructions.m</param.exclude.filters> | ||
BuildInstructions.m | ||
automateTests.m | ||
slprj | ||
tau | ||
Simulations | ||
runMultipleTSPLIBproblems.m | ||
script_runMultipleTSPLIBproblems.m</param.exclude.filters> | ||
<param.examples><?xml version="1.0" encoding="utf-8"?> | ||
<examples> | ||
<exampleCategory name="Solving the Traveling Salesman Problem using Hopfield Networks"> | ||
<exampleCategory name="Solving the Optimization problems using Hopfield Networks"> | ||
<example name="Solving the TSP with cities in Polygon Vertices" type="html"> | ||
<file type="source">/help/html/Example_tspUsingRegularPolygons.html</file> | ||
<file type="main">/help/Example_tspUsingRegularPolygons.m</file> | ||
|
@@ -78,6 +87,27 @@ BuildInstructions.m</param.exclude.filters> | |
<file type="main">/help/Example_tspUsingDistance.m</file> | ||
<file type="thumbnail"/> | ||
</example> | ||
<example name="Solving a GQKP problem using a Hopfield Network" type="html"> | ||
<file type="source">/help/html/Example_GQKPusingCHN.html</file> | ||
<file type="main">/help/Example_GQKPusingCHN.m</file> | ||
<file type="thumbnail">/help/html/Example_GQKPusingCHN.png</file> | ||
<file type="image">/help/html/Example_GQKPusingCHN_01.png</file> | ||
</example> | ||
</exampleCategory> | ||
<exampleCategory name="Solving Hopfield Networks using Simulink"> | ||
<example name="Solving Discrete Hopfield Networks using Simulink" type="html"> | ||
<file type="source">/help/html/Example_SimulinkDiscrete.html</file> | ||
<file type="main">/help/Example_SimulinkDiscrete.m</file> | ||
<file type="thumbnail">/help/html/Example_SimulinkDiscrete.png</file> | ||
<file type="image">/help/html/Example_SimulinkDiscrete_01.png</file> | ||
<file type="image">/help/html/Example_SimulinkDiscrete_02.png</file> | ||
</example> | ||
<example name="Solving Continuous Hopfield Networks using Simulink" type="html"> | ||
<file type="source">/help/html/Example_SimulinkContinuous.html</file> | ||
<file type="main">/help/Example_SimulinkContinuous.m</file> | ||
<file type="thumbnail">/help/html/Example_SimulinkContinuous.png</file> | ||
<file type="image">/help/html/Example_SimulinkContinuous_01.png</file> | ||
</example> | ||
</exampleCategory> | ||
<exampleCategory name="Improving Hopfield Network performance when applied to the TSP"> | ||
<example name="Reduce the free parameter C" type="html"> | ||
|
@@ -99,6 +129,12 @@ BuildInstructions.m</param.exclude.filters> | |
<file type="thumbnail">/help/html/Example_tspDivideConquer.png</file> | ||
<file type="image">/help/html/Example_tspDivideConquer_01.png</file> | ||
</example> | ||
<example name="CHN as a 2-opt Algorithm" type="html"> | ||
<file type="source">/help/html/Example_tsp2opt.html</file> | ||
<file type="main">/help/Example_tsp2opt.m</file> | ||
<file type="thumbnail">/help/html/Example_tsp2opt.png</file> | ||
<file type="image">/help/html/Example_tsp2opt_01.png</file> | ||
</example> | ||
</exampleCategory> | ||
</examples></param.examples> | ||
<param.demosxml /> | ||
|
@@ -119,16 +155,12 @@ BuildInstructions.m</param.exclude.filters> | |
<file>E:\Users\Lucas\Documents\GitHub\HopfieldNetworkToolbox</file> | ||
</fileset.rootdir> | ||
<fileset.rootfiles> | ||
<file>${PROJECT_ROOT}\@hopfieldnet</file> | ||
<file>${PROJECT_ROOT}\@hopfieldnetwork</file> | ||
<file>${PROJECT_ROOT}\@tsphopfieldnet</file> | ||
<file>${PROJECT_ROOT}\@tsphopfieldnetApp</file> | ||
<file>${PROJECT_ROOT}\@tsplib</file> | ||
<file>${PROJECT_ROOT}\chn</file> | ||
<file>${PROJECT_ROOT}\data</file> | ||
<file>${PROJECT_ROOT}\help</file> | ||
<file>${PROJECT_ROOT}\Hopfield Net TSP solver.mlappinstall</file> | ||
<file>${PROJECT_ROOT}\LICENSE</file> | ||
<file>${PROJECT_ROOT}\setup_TSPLIB.m</file> | ||
<file>${PROJECT_ROOT}\TSPFiles</file> | ||
</fileset.rootfiles> | ||
<fileset.depfun.included /> | ||
<fileset.depfun.excluded /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,13 @@ The Continuous Hopfield Network (CHN) is a **recurrent neural network** with an | |
As the Lyapunov function is associated with an objective function of the optimization problem (i.e. the mapping process), the equilibrium, or stable point, helps identify a local optimum for the optimization problem. | ||
The dynamics of the CHN is described by a **differential equation**: | ||
|
||
![\frac{du}{dt} = - \frac{u}{\Lambda} + T v + i^b](http://mathurl.com/hzhnzj5.png) | ||
![\frac{du}{dt} = - \frac{u}{\lambda} + T v + i^b](http://mathurl.com/ycfv6hhd.png) | ||
|
||
and the output function is a hyperbolic tangent: | ||
|
||
![v_i = g(u_i) = \frac{1}{2} \left( 1 + \tanh \left( \frac{u_i}{u_0} \right) \right), \qquad u_0 > 0](http://mathurl.com/zdeg52h.png) | ||
|
||
The existence of an equilibrium point is guaranteed if a Lyapunov or energy function exists. The idea is that the network's Lyapunov function, when ![\Lambda \rightarrow{} \infty](http://mathurl.com/hl2t4by.png), is associated with the cost function to be minimized in the combinatorial problem. | ||
The existence of an equilibrium point is guaranteed if a Lyapunov or energy function exists. The idea is that the network's Lyapunov function, when ![\lambda \rightarrow{} \infty](http://mathurl.com/ydye9fha.png), is associated with the cost function to be minimized in the combinatorial problem. | ||
|
||
The CHN will solve those combinatorial problems which can be expressed as the constrained minimization of: | ||
|
||
|
@@ -37,11 +37,12 @@ Want to contribute? Great! Feel free to fork the repository and contact us for i | |
## Questions? | ||
Open a new Issue and label it as a question. We will get back to you. | ||
|
||
## References | ||
## Major References | ||
- [“Neural” computation of decisions in optimization problems](http://www.ams.org/mathscinet-getitem?mr=824597) | ||
- [A continuous Hopfield network equilibrium points algorithm](http://www.sciencedirect.com/science/article/pii/S0305054804000243) | ||
- [Parameter setting of the Hopfield network applied to TSP](http://www.sciencedirect.com/science/article/pii/S0893608002000217) | ||
- [Improving the Hopfield model performance when applied to the traveling salesman problem: A divide-and-conquer scheme](http://link.springer.com/article/10.1007/s00500-016-2039-8) | ||
- [Attractor basin analysis of the Hopfield model: The Generalized Quadratic Knapsack Problem. In International Work-Conference on Artificial Neural Networks (2017)](https://link.springer.com/chapter/10.1007%2F978-3-319-59153-7_37) | ||
|
||
## Contact us | ||
Send us an [Email](mailto:[email protected]) with your comments/suggestions. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
function cb_closeApp(app,~) | ||
|
||
selection = questdlg('Close Hopfield Net TSP solver App?',... | ||
'Close App?',... | ||
'Yes','No','Yes'); | ||
switch selection | ||
case 'Yes' | ||
warning('on','tsphopfieldnet:NotSimulated'); | ||
warning('on','MATLAB:MKDIR:DirectoryExists'); | ||
delete(app.figure); | ||
case 'No' | ||
return; | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
function cb_scheme(app,~) | ||
|
||
problemIsSelected = verifyProblemIsSelected(app); | ||
if ~problemIsSelected | ||
msgbox('Please select first the problem to solve', 'Error', 'error'); | ||
app.schemeMenu.Value = 1; | ||
return; | ||
end | ||
schemes = app.schemeMenu.String; | ||
|
||
chosenScheme = schemes{app.schemeMenu.Value}; | ||
|
||
if strncmp(chosenScheme,'divide-conquer',14) | ||
app.cities_tauEdit.Enable = 'on'; | ||
tau = max(3,round(getTrainParam(app.net,'N')/10)); | ||
setCities(app.net,'Tau',tau); | ||
app.cities_tauEdit.String = num2str(tau); | ||
|
||
train(app.net); | ||
trainParams = getTrainParam(app.net); | ||
|
||
app.parameterAEdit.String = num2str(trainParams.A); | ||
app.parameterBEdit.String = num2str(trainParams.B); | ||
app.parameterDEdit.String = num2str(1/trainParams.dUaux); | ||
|
||
app.parameterNEdit.String = num2str(trainParams.N); | ||
app.parameterNpEdit.String = num2str(trainParams.Np); | ||
app.cities_tauEdit.String = num2str(getCities(app.net,'Tau')); | ||
else | ||
app.cities_tauEdit.Enable = 'off'; | ||
end | ||
|
||
if ~isempty(app.net) && ~strcmp(chosenScheme,'Scheme') | ||
setScheme(app.net, chosenScheme) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.