Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial for PLUMED added #2

Open
wants to merge 2 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
mkMenu("gismo", "GISMO");
mkMenu("manu", "MANUAL");
mkMenu("tuts", "TUTORIAL");
// mkMenu("plumed_tuts", "PLUMED");
</script>
</div>
</div></div>
Expand Down
21 changes: 21 additions & 0 deletions pages/plumed_tuts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<script type="text/javascript">
// default subpage
pageQuery.psub = typeof pageQuery.psub !== "undefined" ? pageQuery.psub : "summary";
</script>

<div class="columns">
<div class="menu" style="margin:10px -10px 0px -10px" id="submenu">
<script type="text/javascript">
mkSubmenu("summary","summary");
mkSubmenu("analysis","analysis");
mkSubmenu("landmarks","landmarks");
mkSubmenu("sketch-map","sketch-map");
mkSubmenu("results","results");
mkSubmenu("projecting","projecting");
mkSubmenu("gnuplot","gnuplot");
</script>
</div>
<script type="text/javascript">
httpInclude("pages/plumed_tuts/"+pageQuery.psub+".html")
</script>
</div>
97 changes: 95 additions & 2 deletions pages/tuts/landmarks.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ <h2> Selecting landmark points </h2>
space, <span class="code">dimlandmark</span> also allows to assign weights proportional to the density
of samples surrounding each sample.
</p>

<div class="cbox">
<div class="head" id="tut-lmark-head" onclick="safe_toggle('tut-lmark','tut-lmark-head');">
running <span class="code">dimlandmark</span> [+-]
Expand All @@ -45,6 +44,100 @@ <h2> Selecting landmark points </h2>
</p>
</div>
</div>
<script type="text/javascript">safe_toggle('tut-lmark','tut-lmark-head');</script>
<script type="text/javascript">safe_toggle('tut-lmark','tut-lmark-head');</script>
<p>
Both of these strategies can also be run in PLUMED
</p>


<div class="pcbox">
<div class="head" id="tut-random+fps-head" onclick="safe_toggle('tut-random+fps','tut-random+fps-head');">
using PLUMED for Random Selection and FPS [+-]
</div>
<div class="body" id="tut-random+fps" style="display: block;">
<p>
The <span class="code">SelectRandomFrames</span> allows user to select a small, representative subset of the high-dimensional data randomly, so that dimensionality reduction can be performed more effectively. <span class="code">USE_ALL_DATA</span> can be replaced with <span class="code">RUN=ii</span> (a number) to use datapoints only after ii steps while selecting randomly from the data.
</p>
<div class="code" >
d: READ FILE=highd-dataset.in VALUES=c.*<br>
OUTPUT_LANDMARKS ... <br>
ARG=d.*<br>
USE_ALL_DATA<br>
METRIC=EUCLIDEAN<br>
LANDMARKS={RANDOM N=300 SEED=-3241 }<br>
LIST_FILE=landmark-random.out<br>
... OUTPUT_LANDMARKS<br>
</div>
<p>
<span class="code">METRIC</span> options specify the distance function employed, <span class="code">RANDOM</span> keyword is used to specify the Random Sampling method to be employed and <span class="code">N</span> is used for the number of landmarks to be selected. <span class="code">LIST_FILE</span> is used to specify the output file where the landmarks are generated. <span class="code">SEED</span> specifies the seed for the random number generator. It should be given different values for different runs. You can download the example file, the plumed input file and the script to prepare the input file <a href='data/sketchmap-0.2.tar.bz2'> as a tarball</a>.
</p>

<p>
The <span class="code">FarthestPointSampling</span> allows user to select a small, representative subset of the high-dimensional data using Farthest Point Sampling technique. All the parameters remain same as defined in Random Sampling method except the key word <span class="code">FPS</span> is used instead of <span class="code">RANDOM</span>
</p>
<div class="code" >
d: READ FILE=highd-dataset.in VALUES=c.*<br>
OUTPUT_LANDMARKS ... <br>
ARG=d.*<br>
USE_ALL_DATA<br>
METRIC=EUCLIDEAN<br>
LANDMARKS={FPS N=300 SEED=1 }<br>
LIST_FILE=landmark-fps.out<br>
... OUTPUT_LANDMARKS<br>
</div>

</div>
</div>
<script type="text/javascript">safe_toggle('tut-random+fps','tut-random+fps-head');</script>
<p>
Apart from the above mentioned strategies, there are some more strategies which can be used to select the landmarks when running the sketchmap algorithm with PLUMED.
</p>
<ul>
<li> Select points using stride - <i>the landmarks are selected after skipping uniform number of frames between two selections. The algorithm calculates the uniform stride length with the number of required landmarks and the total data.</i> </li>
<li> Select points using a staged sampling from the trajectory - <i>the landmarks are selected in two stages. First a relatively larger number of intermediate landmarks are selected, using farthest point sampling. After this these landmarks are used to calculate voronoi weights and random sampling is done based on the weights in each voronoi region and final selection is made.</i></li>
</ul>



<div class="pcbox">
<div class="head" id="tut-stride-head" onclick="safe_toggle('tut-stride','tut-stride-head');">
using PLUMED for Selection with Stride and Staged Sampling [+-]
</div>
<div class="body" id="tut-stride" style="display: block;">
<p>
The Stride Sampling allows user to select a representative subset of the high-dimensional data using strides of predefined constant step length.
</p>
<div class="code" >
d: READ FILE=highd-dataset.in VALUES=c.*<br>
OUTPUT_LANDMARKS ... <br>
ARG=d.*<br>
USE_ALL_DATA<br>
METRIC=EUCLIDEAN<br>
LANDMARKS={STRIDE N=300 }<br>
LIST_FILE=landmark-stride.out<br>
... OUTPUT_LANDMARKS<br>
</div>
<p>
<!-- You can download the example file, the plumed input file and the script to prepare the input file <a href='data/sketchmap-0.2.tar.bz2'> as a tarball</a>. -->
</p>
<p>
The <span class="code">StagedSampling</span> allows user to select a representative subset of the high-dimensional data using Staged Sampling technique. All the parameters remain same as defined in Random Sampling method except the key word <span class="code">STAGED</span> is used and another parameter <span class="code">GAMMA</span> is specified which determines TODO.
</p>
<div class="code" >
d: READ FILE=highd-dataset.in VALUES=c.*<br>
OUTPUT_LANDMARKS ... <br>
ARG=d.*<br>
USE_ALL_DATA<br>
METRIC=EUCLIDEAN<br>
LANDMARKS={STAGED N=300 SEED=1 GAMMA=0.5}<br>
LIST_FILE=landmark-staged.out<br>
... OUTPUT_LANDMARKS<br>
</div>
<p>
<!-- You can download the example file, the plumed input file and the script to prepare the input file <a href='data/sketchmap-0.2.tar.bz2'> as a tarball</a>. -->
</p>
</div>
</div>
<script type="text/javascript">safe_toggle('tut-stride','tut-stride-head');</script>

</div>
45 changes: 40 additions & 5 deletions pages/tuts/sketch-map.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,46 @@ <h2> Running sketch-map </h2>
</p>
</div>
</div>

<script type="text/javascript">safe_toggle('tut-script','tut-script-head');</script>
<p>
The sketchmap can also be run under PLUMED framework. The following code explains the functionality available in the current implementation of the sketchmap algorithm in PLUMED.
</p>
<div class="pcbox">
<div class="head" id="tut-script+plumed-head" onclick="safe_toggle('tut-script+plumed','tut-script+plumed-head');">
running <span class="code">Sketchmap</span> in PLUMED [+-]
</div>
<div class="body" id="tut-script+plumed" style="display: block;">
<p>
Following code uses all dataset to run the sketch-map optimization which is decsribed in detail below.
</p>
<div class="code" >
d: READ FILE=input.in VALUES=c.*<br/>
SKETCHMAP ...<br/>
ARG=d.*<br/>
NLOW_DIM=2<br/>
USE_ALL_DATA<br/>
HIGH_DIM_FUNCTION={SMAP R_0=1 A=3 B=2}<br/>
LOW_DIM_FUNCTION={SMAP R_0=1 A=1 B=2}<br/>
OUTPUT_FILE=smap-out<br/>
EMBEDDING_OFILE=smap-embed<br/>
... SKETCHMAP<br/>

</div>
The parameters required and the functionality is detailed below:
<ul>
<li>The <span class="code">NLOW_DIM</span> allows user to specify the dimension to which the projection is done </li>
<li>The <span class="code">USE_ALL_DATA</span> allows user to perform sketchmap optimization on the complete dataset. This can be replaced with Landmark Selection to do optimization on only the selected landmark points. </li>
<li>The <span class="code">SMAP</span> is specified to use SMACOF algorithm for sketch-map optimization. </li>
<li>The <span class="code">R_0</span>, <span class="code">A</span> and <span class="code">B</span> specify the sigma value and the parameters of sigmoid function respectively.</li>
</ul>

</div>
</div>
<script type="text/javascript">safe_toggle('tut-script+plumed','tut-script+plumed-head');</script>

<br/>
<br/>
<br/>
<br/>


<h2> A detailed description of the process </h2>

Expand Down Expand Up @@ -110,8 +144,9 @@ <h3> Getting a starting map: running linear MDS </h3>
</p>
</div>
</div>
<script type="text/javascript">safe_toggle('tut-mds','tut-mds-head');</script>

<script type="text/javascript">safe_toggle('tut-mds','tut-mds-head');</script>


<img src="pages/tuts/ala_gmdsplot.png" alt="Linear MDS embedding of 12-ala data, colored based on one of the dihedrals" class="floatleft"/>
<h3> Iterative metric MDS and pointwise-global optimization </h3>
<p>
Expand Down
5 changes: 5 additions & 0 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
<loc>http://epfl-cosmo.github.io/sketchmap/index.htm?page=tuts</loc>
<changefreq>weekly</changefreq>
<priority>0.5000</priority>
</url>
<url>
<loc>http://epfl-cosmo.github.io/sketchmap/index.htm?page=plumed_tuts</loc>
<changefreq>weekly</changefreq>
<priority>0.5000</priority>
</url>
<url>
<loc>http://epfl-cosmo.github.io/sketchmap/index.htm?page=manu</loc>
Expand Down
22 changes: 22 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,27 @@ div.code {
padding:1em; font-family:"Courier"; font-weight:bold;
background: #ffe4be;
}
/* for plumed codes */
div.pcbox {
padding:0; margin:2em; background: #fff5f1; clear:both; display:block
}

div.pcbox .head {
background: #FFAC8A; font-weight:bold;
padding:5px; margin:0; cursor:pointer;
}

div.pcbox .body {
padding:0.5em; margin:0;
}

/* links & pc */
a img { border:0 }

.pcode {font-family:"Courier"; font-weight:bold;}

div.pcode {
padding:1em; font-family:"Courier"; font-weight:bold;
background: #ffe4be;
}