2424# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2525# SOFTWARE.
2626# =============================================================================================== #
27- from scipy .optimize import minimize ,fmin_ncg ,minimize_scalar ,root
27+ from scipy .optimize import minimize , fmin_ncg , minimize_scalar , root
2828import multiprocess as mp
2929import copy
3030from . import mean_field_ising
@@ -147,7 +147,8 @@ def solve(self,
147147 Returns
148148 -------
149149 ndarray
150- Solved multipliers (parameters).
150+ Solved multipliers (parameters). For Ising problem, these can be converted
151+ into matrix format using utils.vec2mat.
151152 dict, optional
152153 Output from scipy.optimize.root.
153154 """
@@ -417,7 +418,8 @@ def solve(self,
417418 Returns
418419 -------
419420 ndarray
420- Solution.
421+ Solved multipliers (parameters). For Ising problem, these can be converted
422+ into matrix format using utils.vec2mat.
421423 dict (optional)
422424 Output from scipy.optimize.minimize returned if full_output is True.
423425 """
@@ -568,7 +570,8 @@ def learn_settings(i):
568570 Returns
569571 -------
570572 ndarray
571- Found solution to inverse problem.
573+ Solved multipliers (parameters). For Ising problem, these can be converted
574+ into matrix format using utils.vec2mat.
572575 int
573576 Error flag.
574577 0, converged within given criterion
@@ -1116,7 +1119,8 @@ def solve(self, force_general=False, **kwargs):
11161119 Returns
11171120 -------
11181121 ndarray
1119- multipliers
1122+ Solved multipliers (parameters). For Ising problem, these can be converted
1123+ into matrix format using utils.vec2mat.
11201124 """
11211125
11221126 if type (self .model ) is Ising and not force_general :
@@ -1690,26 +1694,31 @@ def solve(self, threshold,
16901694 ----------
16911695 threshold : float
16921696 meanFieldRef : bool, False
1693- Expand about mean-field reference
1697+ Expand about mean-field reference.
16941698 independentRef : bool, True
1695- Expand about independent reference
1699+ Expand about independent reference.
16961700 priorLmbda : float, 0.
1697- Strength of non-interacting prior
1701+ Strength of non-interacting prior.
16981702 meanFieldPriorLmbda : float, None
16991703 Strength of non-interacting prior in mean field calculation (defaults to
1700- priorLmbda)
1704+ priorLmbda).
17011705
17021706 Returns
17031707 -------
1704- With full_output=False, returns
1705- J : Estimated interaction matrix
1706-
1707- With full_output=True, returns
1708- ent : Estimated entropy
1709- J : Estimated interaction matrix
1710- clusters : List of clusters
1711- deltaSdict :
1712- deltaJdict :
1708+ ndarray
1709+ Solved multipliers (parameters). For Ising problem, these can be converted
1710+ into matrix format using utils.vec2mat.
1711+ float (optional, only if full_output=True)
1712+ Estimated entropy.
1713+ ndarray
1714+ Solved multipliers (parameters). For Ising problem, these can be converted
1715+ into matrix format using utils.vec2mat.
1716+ list (optional, only if full_output=True)
1717+ List of clusters.
1718+ dict (optional, only if full_output=True)
1719+ deltaSdict
1720+ dict (optional, only if full_output=True)
1721+ deltaJdict
17131722 """
17141723
17151724 # convert input to coocMat
@@ -1776,7 +1785,7 @@ def solve(self, threshold,
17761785 self .multipliers = convert_params ( h , squareform (J )* 2 , '11' , concat = True )
17771786
17781787 if full_output :
1779- return ent , self .multipliers , clusters , deltaSdict , deltaJdict
1788+ return self .multipliers , ent , clusters , deltaSdict , deltaJdict
17801789 else :
17811790 return self .multipliers
17821791# end ClusterExpansion
@@ -1840,6 +1849,8 @@ def solve(self,
18401849 """Varies the strength of regularization on the mean field J to best fit given
18411850 cooccurrence data.
18421851
1852+ Parameters
1853+ ----------
18431854 n_grid_points : int, 200
18441855 If bracket is given, first test at n_grid_points points evenly spaced in the
18451856 bracket interval, then give the lowest three points to
@@ -1862,6 +1873,12 @@ def solve(self,
18621873 priorLmbda : float,0.
18631874 ** As of v1.0.3, not currently implemented **
18641875 Strength of noninteracting prior.
1876+
1877+ Returns
1878+ -------
1879+ ndarray
1880+ Solved multipliers (parameters). For Ising problem, these can be converted
1881+ into matrix format using utils.vec2mat.
18651882 """
18661883
18671884 from scipy import transpose
0 commit comments