Skip to content

Commit

Permalink
add note about $ for offline docs
Browse files Browse the repository at this point in the history
  • Loading branch information
stsievert committed Apr 10, 2022
1 parent 2f409f4 commit 6f51f8a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
1 change: 0 additions & 1 deletion docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ Passive Algorithms

salmon.triplets.samplers.Random
salmon.triplets.samplers.RoundRobin
salmon.triplets.samplers.RoundRobinPerUser
salmon.triplets.samplers.Validation

Active Algorithms
Expand Down
27 changes: 24 additions & 3 deletions docs/source/offline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ clicking the link on the dashboard (as mentioned in :ref:`exp-monitoring`).
Install Salmon
--------------

This section has two dependencies:

1. Git for the ``git`` command. `Git-SCM`_ has a good installation guide.
2. The ``conda`` package manager, available through Anaconda with their
`Anaconda Python Distribution`_ or their (much smaller) `Miniconda`_.

.. _Anaconda Python Distribution: https://www.anaconda.com/products/distribution#Downloads
.. _Miniconda: https://docs.conda.io/en/latest/miniconda.html
.. _Git-SCM: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

To install Salmon, these commands should be run:

.. code-block:: shell
$ git clone https://github.com/stsievert/salmon
Expand All @@ -36,10 +48,19 @@ Install Salmon
$ conda activate salmon
(salmon) $ pip install -e .
These commands should be run in your favorite terminal. On macOS, that might
be Terminal.app.

.. note::

The commands above are (\*nix) shell commands. The ``$`` is intended to
be your terminal prompt; leave it out when copy and pasting into the
terminal.

Generate embeddings
-------------------

This code will generate an embedding:
This Python code will generate an embedding:

.. code-block:: python
Expand All @@ -54,7 +75,7 @@ This code will generate an embedding:
d = 2 # embed into 2 dimensions
X_train, X_test = train_test_split(X, random_state=42, test_size=0.2)
model = OfflineEmbedding(n=n, d=d)
model = OfflineEmbedding(n=n, d=d, max_epochs=500_000)
model.initialize(X_train, embedding=em.to_numpy())
model.fit(X_train, X_test)
Expand All @@ -63,7 +84,7 @@ This code will generate an embedding:
model.history_ # to view information on how well train/test performed
Some customization can be done with ``model.history_``; it may not be necessary
to train for 400,000 epochs. ``model.history_`` will include validation and
to train for 500,000 epochs. ``model.history_`` will include validation and
training scores, which might help limit the number of epochs.

Documentation for :class:`~salmon.triplets.offline.OfflineEmbedding` is
Expand Down

0 comments on commit 6f51f8a

Please sign in to comment.