849 lines
47 KiB
HTML
849 lines
47 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.11"/>
|
|
<title>mlpack: mlpack::optimization::MiniBatchSGD< DecomposableFunctionType > Class Template Reference</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(function() { init_search(); });
|
|
</script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<link href="extra-stylesheet.css" rel="stylesheet" type="text/css"/>
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">mlpack
|
|
 <span id="projectnumber">master</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.11 -->
|
|
<script type="text/javascript">
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
</script>
|
|
<div id="navrow1" class="tabs">
|
|
<ul class="tablist">
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
|
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
<li>
|
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
|
<span class="left">
|
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
alt=""/>
|
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
|
</span><span class="right">
|
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
|
</span>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div id="navrow2" class="tabs2">
|
|
<ul class="tablist">
|
|
<li><a href="annotated.html"><span>Class List</span></a></li>
|
|
<li><a href="classes.html"><span>Class Index</span></a></li>
|
|
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
|
|
<li><a href="functions.html"><span>Class Members</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="namespacemlpack.html">mlpack</a></li><li class="navelem"><a class="el" href="namespacemlpack_1_1optimization.html">optimization</a></li><li class="navelem"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">MiniBatchSGD</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="#pri-attribs">Private Attributes</a> |
|
|
<a href="classmlpack_1_1optimization_1_1MiniBatchSGD-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">mlpack::optimization::MiniBatchSGD< DecomposableFunctionType > Class Template Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>Mini-batch Stochastic Gradient Descent is a technique for minimizing a function which can be expressed as a sum of other functions.
|
|
<a href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#details">More...</a></p>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
|
|
Public Member Functions</h2></td></tr>
|
|
<tr class="memitem:a15035e9fb9538743cd8bd3e05fd31977"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#a15035e9fb9538743cd8bd3e05fd31977">MiniBatchSGD</a> (DecomposableFunctionType &<a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#a0140eedeab2cb8f7f2fb12f682d11840">function</a>, const size_t <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#aa87b27e65bb995d63cc976c7c9fd9d52">batchSize</a>=1000, const double <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#a5695a8062e02b0bdc48723b75f215ca3">stepSize</a>=0.01, const size_t <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#ad88647ff30103350ba0ac296e965993d">maxIterations</a>=100000, const double <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#afbcad6a84e07072c718b68049d27ece8">tolerance</a>=1e-5, const bool shuffle=true)</td></tr>
|
|
<tr class="memdesc:a15035e9fb9538743cd8bd3e05fd31977"><td class="mdescLeft"> </td><td class="mdescRight">Construct the <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html" title="Mini-batch Stochastic Gradient Descent is a technique for minimizing a function which can be expresse...">MiniBatchSGD</a> optimizer with the given function and parameters. <a href="#a15035e9fb9538743cd8bd3e05fd31977">More...</a><br /></td></tr>
|
|
<tr class="separator:a15035e9fb9538743cd8bd3e05fd31977"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aa680a3700b1105df18a8f85374b56638"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#aa680a3700b1105df18a8f85374b56638">BatchSize</a> () const </td></tr>
|
|
<tr class="memdesc:aa680a3700b1105df18a8f85374b56638"><td class="mdescLeft"> </td><td class="mdescRight">Get the batch size. <a href="#aa680a3700b1105df18a8f85374b56638">More...</a><br /></td></tr>
|
|
<tr class="separator:aa680a3700b1105df18a8f85374b56638"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ad901c56284441c5bb5af30b549e2ae8a"><td class="memItemLeft" align="right" valign="top">size_t & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#ad901c56284441c5bb5af30b549e2ae8a">BatchSize</a> ()</td></tr>
|
|
<tr class="memdesc:ad901c56284441c5bb5af30b549e2ae8a"><td class="mdescLeft"> </td><td class="mdescRight">Modify the batch size. <a href="#ad901c56284441c5bb5af30b549e2ae8a">More...</a><br /></td></tr>
|
|
<tr class="separator:ad901c56284441c5bb5af30b549e2ae8a"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a55758ee335253b0e0b2f82e4a01ee965"><td class="memItemLeft" align="right" valign="top">const DecomposableFunctionType & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#a55758ee335253b0e0b2f82e4a01ee965">Function</a> () const </td></tr>
|
|
<tr class="memdesc:a55758ee335253b0e0b2f82e4a01ee965"><td class="mdescLeft"> </td><td class="mdescRight">Get the instantiated function to be optimized. <a href="#a55758ee335253b0e0b2f82e4a01ee965">More...</a><br /></td></tr>
|
|
<tr class="separator:a55758ee335253b0e0b2f82e4a01ee965"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a35502af6b3f7732738e2caf8eb8fe96c"><td class="memItemLeft" align="right" valign="top">DecomposableFunctionType & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#a35502af6b3f7732738e2caf8eb8fe96c">Function</a> ()</td></tr>
|
|
<tr class="memdesc:a35502af6b3f7732738e2caf8eb8fe96c"><td class="mdescLeft"> </td><td class="mdescRight">Modify the instantiated function. <a href="#a35502af6b3f7732738e2caf8eb8fe96c">More...</a><br /></td></tr>
|
|
<tr class="separator:a35502af6b3f7732738e2caf8eb8fe96c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a35a9ef041c0bb3f940e78593754ac536"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#a35a9ef041c0bb3f940e78593754ac536">MaxIterations</a> () const </td></tr>
|
|
<tr class="memdesc:a35a9ef041c0bb3f940e78593754ac536"><td class="mdescLeft"> </td><td class="mdescRight">Get the maximum number of iterations (0 indicates no limit). <a href="#a35a9ef041c0bb3f940e78593754ac536">More...</a><br /></td></tr>
|
|
<tr class="separator:a35a9ef041c0bb3f940e78593754ac536"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a5dd0b12834b720a696a6d33ef438f93e"><td class="memItemLeft" align="right" valign="top">size_t & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#a5dd0b12834b720a696a6d33ef438f93e">MaxIterations</a> ()</td></tr>
|
|
<tr class="memdesc:a5dd0b12834b720a696a6d33ef438f93e"><td class="mdescLeft"> </td><td class="mdescRight">Modify the maximum number of iterations (0 indicates no limit). <a href="#a5dd0b12834b720a696a6d33ef438f93e">More...</a><br /></td></tr>
|
|
<tr class="separator:a5dd0b12834b720a696a6d33ef438f93e"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ab6ba9ce7ae508fe85c7620576a68f20a"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#ab6ba9ce7ae508fe85c7620576a68f20a">Optimize</a> (arma::mat &iterate)</td></tr>
|
|
<tr class="memdesc:ab6ba9ce7ae508fe85c7620576a68f20a"><td class="mdescLeft"> </td><td class="mdescRight">Optimize the given function using mini-batch <a class="el" href="classmlpack_1_1optimization_1_1SGD.html" title="Stochastic Gradient Descent is a technique for minimizing a function which can be expressed as a sum ...">SGD</a>. <a href="#ab6ba9ce7ae508fe85c7620576a68f20a">More...</a><br /></td></tr>
|
|
<tr class="separator:ab6ba9ce7ae508fe85c7620576a68f20a"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a73566d6bfca44f2b0c77650c01fbff1e"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#a73566d6bfca44f2b0c77650c01fbff1e">Shuffle</a> () const </td></tr>
|
|
<tr class="memdesc:a73566d6bfca44f2b0c77650c01fbff1e"><td class="mdescLeft"> </td><td class="mdescRight">Get whether or not the individual functions are shuffled. <a href="#a73566d6bfca44f2b0c77650c01fbff1e">More...</a><br /></td></tr>
|
|
<tr class="separator:a73566d6bfca44f2b0c77650c01fbff1e"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ab2ca6ae65a0dca7b18ae56d2c1340e05"><td class="memItemLeft" align="right" valign="top">bool & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#ab2ca6ae65a0dca7b18ae56d2c1340e05">Shuffle</a> ()</td></tr>
|
|
<tr class="memdesc:ab2ca6ae65a0dca7b18ae56d2c1340e05"><td class="mdescLeft"> </td><td class="mdescRight">Modify whether or not the individual functions are shuffled. <a href="#ab2ca6ae65a0dca7b18ae56d2c1340e05">More...</a><br /></td></tr>
|
|
<tr class="separator:ab2ca6ae65a0dca7b18ae56d2c1340e05"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a00169352ab9074e067ab37864e115dbb"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#a00169352ab9074e067ab37864e115dbb">StepSize</a> () const </td></tr>
|
|
<tr class="memdesc:a00169352ab9074e067ab37864e115dbb"><td class="mdescLeft"> </td><td class="mdescRight">Get the step size. <a href="#a00169352ab9074e067ab37864e115dbb">More...</a><br /></td></tr>
|
|
<tr class="separator:a00169352ab9074e067ab37864e115dbb"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a3899b6a9ded146d82bb4458c03302073"><td class="memItemLeft" align="right" valign="top">double & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#a3899b6a9ded146d82bb4458c03302073">StepSize</a> ()</td></tr>
|
|
<tr class="memdesc:a3899b6a9ded146d82bb4458c03302073"><td class="mdescLeft"> </td><td class="mdescRight">Modify the step size. <a href="#a3899b6a9ded146d82bb4458c03302073">More...</a><br /></td></tr>
|
|
<tr class="separator:a3899b6a9ded146d82bb4458c03302073"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a90c9709a7dd0312d5ff93a312a5fe9db"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#a90c9709a7dd0312d5ff93a312a5fe9db">Tolerance</a> () const </td></tr>
|
|
<tr class="memdesc:a90c9709a7dd0312d5ff93a312a5fe9db"><td class="mdescLeft"> </td><td class="mdescRight">Get the tolerance for termination. <a href="#a90c9709a7dd0312d5ff93a312a5fe9db">More...</a><br /></td></tr>
|
|
<tr class="separator:a90c9709a7dd0312d5ff93a312a5fe9db"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a8bf3c9ed107adb32109657f443a747a7"><td class="memItemLeft" align="right" valign="top">double & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#a8bf3c9ed107adb32109657f443a747a7">Tolerance</a> ()</td></tr>
|
|
<tr class="memdesc:a8bf3c9ed107adb32109657f443a747a7"><td class="mdescLeft"> </td><td class="mdescRight">Modify the tolerance for termination. <a href="#a8bf3c9ed107adb32109657f443a747a7">More...</a><br /></td></tr>
|
|
<tr class="separator:a8bf3c9ed107adb32109657f443a747a7"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
|
|
Private Attributes</h2></td></tr>
|
|
<tr class="memitem:aa87b27e65bb995d63cc976c7c9fd9d52"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#aa87b27e65bb995d63cc976c7c9fd9d52">batchSize</a></td></tr>
|
|
<tr class="memdesc:aa87b27e65bb995d63cc976c7c9fd9d52"><td class="mdescLeft"> </td><td class="mdescRight">The size of each mini-batch. <a href="#aa87b27e65bb995d63cc976c7c9fd9d52">More...</a><br /></td></tr>
|
|
<tr class="separator:aa87b27e65bb995d63cc976c7c9fd9d52"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a0140eedeab2cb8f7f2fb12f682d11840"><td class="memItemLeft" align="right" valign="top">DecomposableFunctionType & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#a0140eedeab2cb8f7f2fb12f682d11840">function</a></td></tr>
|
|
<tr class="memdesc:a0140eedeab2cb8f7f2fb12f682d11840"><td class="mdescLeft"> </td><td class="mdescRight">The instantiated function. <a href="#a0140eedeab2cb8f7f2fb12f682d11840">More...</a><br /></td></tr>
|
|
<tr class="separator:a0140eedeab2cb8f7f2fb12f682d11840"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ad88647ff30103350ba0ac296e965993d"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#ad88647ff30103350ba0ac296e965993d">maxIterations</a></td></tr>
|
|
<tr class="memdesc:ad88647ff30103350ba0ac296e965993d"><td class="mdescLeft"> </td><td class="mdescRight">The maximum number of allowed iterations. <a href="#ad88647ff30103350ba0ac296e965993d">More...</a><br /></td></tr>
|
|
<tr class="separator:ad88647ff30103350ba0ac296e965993d"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a9d2859a232290853a81d2ca143882f35"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#a9d2859a232290853a81d2ca143882f35">shuffle</a></td></tr>
|
|
<tr class="memdesc:a9d2859a232290853a81d2ca143882f35"><td class="mdescLeft"> </td><td class="mdescRight">Controls whether or not the individual functions are shuffled when iterating. <a href="#a9d2859a232290853a81d2ca143882f35">More...</a><br /></td></tr>
|
|
<tr class="separator:a9d2859a232290853a81d2ca143882f35"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a5695a8062e02b0bdc48723b75f215ca3"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#a5695a8062e02b0bdc48723b75f215ca3">stepSize</a></td></tr>
|
|
<tr class="memdesc:a5695a8062e02b0bdc48723b75f215ca3"><td class="mdescLeft"> </td><td class="mdescRight">The step size for each example. <a href="#a5695a8062e02b0bdc48723b75f215ca3">More...</a><br /></td></tr>
|
|
<tr class="separator:a5695a8062e02b0bdc48723b75f215ca3"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:afbcad6a84e07072c718b68049d27ece8"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html#afbcad6a84e07072c718b68049d27ece8">tolerance</a></td></tr>
|
|
<tr class="memdesc:afbcad6a84e07072c718b68049d27ece8"><td class="mdescLeft"> </td><td class="mdescRight">The tolerance for termination. <a href="#afbcad6a84e07072c718b68049d27ece8">More...</a><br /></td></tr>
|
|
<tr class="separator:afbcad6a84e07072c718b68049d27ece8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><h3>template<typename DecomposableFunctionType><br />
|
|
class mlpack::optimization::MiniBatchSGD< DecomposableFunctionType ></h3>
|
|
|
|
<p>Mini-batch Stochastic Gradient Descent is a technique for minimizing a function which can be expressed as a sum of other functions. </p>
|
|
<p>That is, suppose we have</p>
|
|
<p class="formulaDsp">
|
|
<img class="formulaDsp" alt="\[ f(A) = \sum_{i = 0}^{n} f_i(A) \]" src="form_41.png"/>
|
|
</p>
|
|
<p>and our task is to minimize <img class="formulaInl" alt="$ A $" src="form_42.png"/>. Mini-batch <a class="el" href="classmlpack_1_1optimization_1_1SGD.html" title="Stochastic Gradient Descent is a technique for minimizing a function which can be expressed as a sum ...">SGD</a> iterates over batches of functions <img class="formulaInl" alt="$ \{ f_{i0}(A), f_{i1}(A), \ldots, f_{i(m - 1)}(A) $" src="form_43.png"/> for some batch size <img class="formulaInl" alt="$ m $" src="form_44.png"/>, producing the following update scheme:</p>
|
|
<p class="formulaDsp">
|
|
<img class="formulaDsp" alt="\[ A_{j + 1} = A_j + \alpha \left(\sum_{k = 0}^{m - 1} \nabla f_{ik}(A) \right) \]" src="form_45.png"/>
|
|
</p>
|
|
<p>where <img class="formulaInl" alt="$ \alpha $" src="form_35.png"/> is a parameter which specifies the step size. Each mini-batch is passed through either sequentially or randomly. The algorithm continues until <img class="formulaInl" alt="$ j $" src="form_37.png"/> reaches the maximum number of iterations—or when a full sequence of updates through each of the mini-batches produces an improvement within a certain tolerance <img class="formulaInl" alt="$ \epsilon $" src="form_38.png"/>.</p>
|
|
<p>The parameter <img class="formulaInl" alt="$ \epsilon $" src="form_38.png"/> is specified by the tolerance parameter tot he constructor, as is the maximum number of iterations specified by the maxIterations parameter.</p>
|
|
<p>This class is useful for data-dependent functions whose objective function can be expressed as a sum of objective functions operating on an individual point. Then, mini-batch <a class="el" href="classmlpack_1_1optimization_1_1SGD.html" title="Stochastic Gradient Descent is a technique for minimizing a function which can be expressed as a sum ...">SGD</a> considers the gradient of the objective function operation on an individual mini-batch of points in its update of <img class="formulaInl" alt="$ A $" src="form_42.png"/>.</p>
|
|
<p>For mini-batch <a class="el" href="classmlpack_1_1optimization_1_1SGD.html" title="Stochastic Gradient Descent is a technique for minimizing a function which can be expressed as a sum ...">SGD</a> to work, a DecomposableFunctionType template parameter is required. This class must implement the following function:</p>
|
|
<p>size_t NumFunctions(); double Evaluate(const arma::mat& coordinates, const size_t i); void Gradient(const arma::mat& coordinates, const size_t i, arma::mat& gradient);</p>
|
|
<p>NumFunctions() should return the number of functions, and in the other two functions, the parameter i refers to which individual function (or gradient) is being evaluated. So, for the case of a data-dependent function, such as NCA (see <a class="el" href="classmlpack_1_1nca_1_1NCA.html" title="An implementation of Neighborhood Components Analysis, both a linear dimensionality reduction techniq...">mlpack::nca::NCA</a>), NumFunctions() should return the number of points in the dataset, and Evaluate(coordinates, 0) will evaluate the objective function on the first point in the dataset (presumably, the dataset is held internally in the DecomposableFunctionType).</p>
|
|
<dl class="tparams"><dt>Template Parameters</dt><dd>
|
|
<table class="tparams">
|
|
<tr><td class="paramname">DecomposableFunctionType</td><td>Decomposable objective function type to be minimized. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p>Definition at line <a class="el" href="minibatch__sgd_8hpp_source.html#l00074">74</a> of file <a class="el" href="minibatch__sgd_8hpp_source.html">minibatch_sgd.hpp</a>.</p>
|
|
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
|
<a class="anchor" id="a15035e9fb9538743cd8bd3e05fd31977"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename DecomposableFunctionType > </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">mlpack::optimization::MiniBatchSGD</a>< DecomposableFunctionType >::<a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">MiniBatchSGD</a> </td>
|
|
<td>(</td>
|
|
<td class="paramtype">DecomposableFunctionType & </td>
|
|
<td class="paramname"><em>function</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const size_t </td>
|
|
<td class="paramname"><em>batchSize</em> = <code>1000</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const double </td>
|
|
<td class="paramname"><em>stepSize</em> = <code>0.01</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const size_t </td>
|
|
<td class="paramname"><em>maxIterations</em> = <code>100000</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const double </td>
|
|
<td class="paramname"><em>tolerance</em> = <code>1e-5</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const bool </td>
|
|
<td class="paramname"><em>shuffle</em> = <code>true</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Construct the <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html" title="Mini-batch Stochastic Gradient Descent is a technique for minimizing a function which can be expresse...">MiniBatchSGD</a> optimizer with the given function and parameters. </p>
|
|
<p>The defaults here are not necessarily good for the given problem, so it is suggested that the values used be tailored for the task at hand. The maximum number of iterations refers to the maximum number of mini-batches that are processed.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">function</td><td>Function to be optimized (minimized). </td></tr>
|
|
<tr><td class="paramname">batchSize</td><td>Size of each mini-batch. </td></tr>
|
|
<tr><td class="paramname">stepSize</td><td>Step size for each iteration. </td></tr>
|
|
<tr><td class="paramname">maxIterations</td><td>Maximum number of iterations allowed (0 means no limit). </td></tr>
|
|
<tr><td class="paramname">tolerance</td><td>Maximum absolute tolerance to terminate algorithm. </td></tr>
|
|
<tr><td class="paramname">shuffle</td><td>If true, the mini-batch order is shuffled; otherwise, each mini-batch is visited in linear order. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a class="anchor" id="aa680a3700b1105df18a8f85374b56638"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename DecomposableFunctionType > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">size_t <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">mlpack::optimization::MiniBatchSGD</a>< DecomposableFunctionType >::BatchSize </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the batch size. </p>
|
|
|
|
<p>Definition at line <a class="el" href="minibatch__sgd_8hpp_source.html#l00116">116</a> of file <a class="el" href="minibatch__sgd_8hpp_source.html">minibatch_sgd.hpp</a>.</p>
|
|
|
|
<p>References <a class="el" href="minibatch__sgd_8hpp_source.html#l00145">mlpack::optimization::MiniBatchSGD< DecomposableFunctionType >::batchSize</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ad901c56284441c5bb5af30b549e2ae8a"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename DecomposableFunctionType > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">size_t& <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">mlpack::optimization::MiniBatchSGD</a>< DecomposableFunctionType >::BatchSize </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Modify the batch size. </p>
|
|
|
|
<p>Definition at line <a class="el" href="minibatch__sgd_8hpp_source.html#l00118">118</a> of file <a class="el" href="minibatch__sgd_8hpp_source.html">minibatch_sgd.hpp</a>.</p>
|
|
|
|
<p>References <a class="el" href="minibatch__sgd_8hpp_source.html#l00145">mlpack::optimization::MiniBatchSGD< DecomposableFunctionType >::batchSize</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a55758ee335253b0e0b2f82e4a01ee965"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename DecomposableFunctionType > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const DecomposableFunctionType& <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">mlpack::optimization::MiniBatchSGD</a>< DecomposableFunctionType >::Function </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the instantiated function to be optimized. </p>
|
|
|
|
<p>Definition at line <a class="el" href="minibatch__sgd_8hpp_source.html#l00111">111</a> of file <a class="el" href="minibatch__sgd_8hpp_source.html">minibatch_sgd.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a35502af6b3f7732738e2caf8eb8fe96c"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename DecomposableFunctionType > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">DecomposableFunctionType& <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">mlpack::optimization::MiniBatchSGD</a>< DecomposableFunctionType >::Function </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Modify the instantiated function. </p>
|
|
|
|
<p>Definition at line <a class="el" href="minibatch__sgd_8hpp_source.html#l00113">113</a> of file <a class="el" href="minibatch__sgd_8hpp_source.html">minibatch_sgd.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a35a9ef041c0bb3f940e78593754ac536"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename DecomposableFunctionType > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">size_t <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">mlpack::optimization::MiniBatchSGD</a>< DecomposableFunctionType >::MaxIterations </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the maximum number of iterations (0 indicates no limit). </p>
|
|
|
|
<p>Definition at line <a class="el" href="minibatch__sgd_8hpp_source.html#l00126">126</a> of file <a class="el" href="minibatch__sgd_8hpp_source.html">minibatch_sgd.hpp</a>.</p>
|
|
|
|
<p>References <a class="el" href="minibatch__sgd_8hpp_source.html#l00151">mlpack::optimization::MiniBatchSGD< DecomposableFunctionType >::maxIterations</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a5dd0b12834b720a696a6d33ef438f93e"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename DecomposableFunctionType > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">size_t& <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">mlpack::optimization::MiniBatchSGD</a>< DecomposableFunctionType >::MaxIterations </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Modify the maximum number of iterations (0 indicates no limit). </p>
|
|
|
|
<p>Definition at line <a class="el" href="minibatch__sgd_8hpp_source.html#l00128">128</a> of file <a class="el" href="minibatch__sgd_8hpp_source.html">minibatch_sgd.hpp</a>.</p>
|
|
|
|
<p>References <a class="el" href="minibatch__sgd_8hpp_source.html#l00151">mlpack::optimization::MiniBatchSGD< DecomposableFunctionType >::maxIterations</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ab6ba9ce7ae508fe85c7620576a68f20a"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename DecomposableFunctionType > </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">mlpack::optimization::MiniBatchSGD</a>< DecomposableFunctionType >::Optimize </td>
|
|
<td>(</td>
|
|
<td class="paramtype">arma::mat & </td>
|
|
<td class="paramname"><em>iterate</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Optimize the given function using mini-batch <a class="el" href="classmlpack_1_1optimization_1_1SGD.html" title="Stochastic Gradient Descent is a technique for minimizing a function which can be expressed as a sum ...">SGD</a>. </p>
|
|
<p>The given starting point will be modified to store the finishing point of the algorithm, and the final objective value is returned.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">iterate</td><td>Starting point (will be modified). </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>Objective value of the final point. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a73566d6bfca44f2b0c77650c01fbff1e"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename DecomposableFunctionType > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">mlpack::optimization::MiniBatchSGD</a>< DecomposableFunctionType >::Shuffle </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get whether or not the individual functions are shuffled. </p>
|
|
|
|
<p>Definition at line <a class="el" href="minibatch__sgd_8hpp_source.html#l00136">136</a> of file <a class="el" href="minibatch__sgd_8hpp_source.html">minibatch_sgd.hpp</a>.</p>
|
|
|
|
<p>References <a class="el" href="minibatch__sgd_8hpp_source.html#l00158">mlpack::optimization::MiniBatchSGD< DecomposableFunctionType >::shuffle</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ab2ca6ae65a0dca7b18ae56d2c1340e05"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename DecomposableFunctionType > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool& <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">mlpack::optimization::MiniBatchSGD</a>< DecomposableFunctionType >::Shuffle </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Modify whether or not the individual functions are shuffled. </p>
|
|
|
|
<p>Definition at line <a class="el" href="minibatch__sgd_8hpp_source.html#l00138">138</a> of file <a class="el" href="minibatch__sgd_8hpp_source.html">minibatch_sgd.hpp</a>.</p>
|
|
|
|
<p>References <a class="el" href="minibatch__sgd_8hpp_source.html#l00158">mlpack::optimization::MiniBatchSGD< DecomposableFunctionType >::shuffle</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a00169352ab9074e067ab37864e115dbb"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename DecomposableFunctionType > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">mlpack::optimization::MiniBatchSGD</a>< DecomposableFunctionType >::StepSize </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the step size. </p>
|
|
|
|
<p>Definition at line <a class="el" href="minibatch__sgd_8hpp_source.html#l00121">121</a> of file <a class="el" href="minibatch__sgd_8hpp_source.html">minibatch_sgd.hpp</a>.</p>
|
|
|
|
<p>References <a class="el" href="minibatch__sgd_8hpp_source.html#l00148">mlpack::optimization::MiniBatchSGD< DecomposableFunctionType >::stepSize</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a3899b6a9ded146d82bb4458c03302073"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename DecomposableFunctionType > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double& <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">mlpack::optimization::MiniBatchSGD</a>< DecomposableFunctionType >::StepSize </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Modify the step size. </p>
|
|
|
|
<p>Definition at line <a class="el" href="minibatch__sgd_8hpp_source.html#l00123">123</a> of file <a class="el" href="minibatch__sgd_8hpp_source.html">minibatch_sgd.hpp</a>.</p>
|
|
|
|
<p>References <a class="el" href="minibatch__sgd_8hpp_source.html#l00148">mlpack::optimization::MiniBatchSGD< DecomposableFunctionType >::stepSize</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a90c9709a7dd0312d5ff93a312a5fe9db"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename DecomposableFunctionType > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">mlpack::optimization::MiniBatchSGD</a>< DecomposableFunctionType >::Tolerance </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the tolerance for termination. </p>
|
|
|
|
<p>Definition at line <a class="el" href="minibatch__sgd_8hpp_source.html#l00131">131</a> of file <a class="el" href="minibatch__sgd_8hpp_source.html">minibatch_sgd.hpp</a>.</p>
|
|
|
|
<p>References <a class="el" href="minibatch__sgd_8hpp_source.html#l00154">mlpack::optimization::MiniBatchSGD< DecomposableFunctionType >::tolerance</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a8bf3c9ed107adb32109657f443a747a7"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename DecomposableFunctionType > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double& <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">mlpack::optimization::MiniBatchSGD</a>< DecomposableFunctionType >::Tolerance </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Modify the tolerance for termination. </p>
|
|
|
|
<p>Definition at line <a class="el" href="minibatch__sgd_8hpp_source.html#l00133">133</a> of file <a class="el" href="minibatch__sgd_8hpp_source.html">minibatch_sgd.hpp</a>.</p>
|
|
|
|
<p>References <a class="el" href="minibatch__sgd_8hpp_source.html#l00154">mlpack::optimization::MiniBatchSGD< DecomposableFunctionType >::tolerance</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Data Documentation</h2>
|
|
<a class="anchor" id="aa87b27e65bb995d63cc976c7c9fd9d52"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename DecomposableFunctionType > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">size_t <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">mlpack::optimization::MiniBatchSGD</a>< DecomposableFunctionType >::batchSize</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>The size of each mini-batch. </p>
|
|
|
|
<p>Definition at line <a class="el" href="minibatch__sgd_8hpp_source.html#l00145">145</a> of file <a class="el" href="minibatch__sgd_8hpp_source.html">minibatch_sgd.hpp</a>.</p>
|
|
|
|
<p>Referenced by <a class="el" href="minibatch__sgd_8hpp_source.html#l00116">mlpack::optimization::MiniBatchSGD< DecomposableFunctionType >::BatchSize()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a0140eedeab2cb8f7f2fb12f682d11840"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename DecomposableFunctionType > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">DecomposableFunctionType& <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">mlpack::optimization::MiniBatchSGD</a>< DecomposableFunctionType >::function</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>The instantiated function. </p>
|
|
|
|
<p>Definition at line <a class="el" href="minibatch__sgd_8hpp_source.html#l00142">142</a> of file <a class="el" href="minibatch__sgd_8hpp_source.html">minibatch_sgd.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ad88647ff30103350ba0ac296e965993d"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename DecomposableFunctionType > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">size_t <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">mlpack::optimization::MiniBatchSGD</a>< DecomposableFunctionType >::maxIterations</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>The maximum number of allowed iterations. </p>
|
|
|
|
<p>Definition at line <a class="el" href="minibatch__sgd_8hpp_source.html#l00151">151</a> of file <a class="el" href="minibatch__sgd_8hpp_source.html">minibatch_sgd.hpp</a>.</p>
|
|
|
|
<p>Referenced by <a class="el" href="minibatch__sgd_8hpp_source.html#l00126">mlpack::optimization::MiniBatchSGD< DecomposableFunctionType >::MaxIterations()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a9d2859a232290853a81d2ca143882f35"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename DecomposableFunctionType > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">mlpack::optimization::MiniBatchSGD</a>< DecomposableFunctionType >::shuffle</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Controls whether or not the individual functions are shuffled when iterating. </p>
|
|
|
|
<p>Definition at line <a class="el" href="minibatch__sgd_8hpp_source.html#l00158">158</a> of file <a class="el" href="minibatch__sgd_8hpp_source.html">minibatch_sgd.hpp</a>.</p>
|
|
|
|
<p>Referenced by <a class="el" href="minibatch__sgd_8hpp_source.html#l00136">mlpack::optimization::MiniBatchSGD< DecomposableFunctionType >::Shuffle()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a5695a8062e02b0bdc48723b75f215ca3"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename DecomposableFunctionType > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">mlpack::optimization::MiniBatchSGD</a>< DecomposableFunctionType >::stepSize</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>The step size for each example. </p>
|
|
|
|
<p>Definition at line <a class="el" href="minibatch__sgd_8hpp_source.html#l00148">148</a> of file <a class="el" href="minibatch__sgd_8hpp_source.html">minibatch_sgd.hpp</a>.</p>
|
|
|
|
<p>Referenced by <a class="el" href="minibatch__sgd_8hpp_source.html#l00121">mlpack::optimization::MiniBatchSGD< DecomposableFunctionType >::StepSize()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="afbcad6a84e07072c718b68049d27ece8"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename DecomposableFunctionType > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double <a class="el" href="classmlpack_1_1optimization_1_1MiniBatchSGD.html">mlpack::optimization::MiniBatchSGD</a>< DecomposableFunctionType >::tolerance</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>The tolerance for termination. </p>
|
|
|
|
<p>Definition at line <a class="el" href="minibatch__sgd_8hpp_source.html#l00154">154</a> of file <a class="el" href="minibatch__sgd_8hpp_source.html">minibatch_sgd.hpp</a>.</p>
|
|
|
|
<p>Referenced by <a class="el" href="minibatch__sgd_8hpp_source.html#l00131">mlpack::optimization::MiniBatchSGD< DecomposableFunctionType >::Tolerance()</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following file:<ul>
|
|
<li>src/mlpack/core/optimizers/minibatch_sgd/<a class="el" href="minibatch__sgd_8hpp_source.html">minibatch_sgd.hpp</a></li>
|
|
</ul>
|
|
</div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.11
|
|
</small></address>
|
|
</body>
|
|
<script type="text/javascript">
|
|
var x = document.getElementsByClassName("formulaDsp");
|
|
var i;
|
|
for (i = 0; i < x.length; i++)
|
|
{
|
|
x[i].width /= 4;
|
|
}
|
|
</script>
|
|
</html>
|