Skip to content

Commit

Permalink
#118 Update documentation after Pull Request #115 [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
sashafrey committed Feb 15, 2015
1 parent 4446920 commit 4106ea5
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 11 deletions.
29 changes: 20 additions & 9 deletions docs/ref/c_interface.txt
Original file line number Diff line number Diff line change
Expand Up @@ -340,35 +340,42 @@ ArtmDisposeDictionary
ArtmAddBatch
------------

.. c:function:: int ArtmAddBatch(int master_id, int length, const char* batch)
.. c:function:: int ArtmAddBatch(int master_id, int length, const char* add_batch_args)

Adds an instance of :ref:`Batch` class to the master component.
Adds batch for processing.

:param int master_id: The ID of a master component or a master proxy,
returned by either :c:func:`ArtmCreateMasterComponent` or :c:func:`ArtmCreateMasterProxy` method.

:param const_char* batch:
Serialized :ref:`Batch` message.
:param const_char* add_batch_args:
Serialized :ref:`AddBatchArgs` message,
describing the arguments of this operation.

:param int length: The length in bytes of the *batch* message.
:param int length: The length in bytes of the *add_batch_args* message.

:return: Returns :c:macro:`ARTM_SUCCESS` value if operation succeeded,
otherwise returns one of the :ref:`error codes <error-codes>`.

This operation is only allowed when
:attr:`MasterComponentConfig.online_batch_processing` is set to *True* and
:attr:`MasterComponentConfig.modus_operandi` is set to *Local*.

ArtmInvokeIteration
-------------------

.. c:function:: int ArtmInvokeIteration(int master_id, int iterations_count)
.. c:function:: int ArtmInvokeIteration(int master_id, int length, const char* invoke_iteration_args)

Invokes several iterations over the collection.

:param int master_id: The ID of a master component or a master proxy,
returned by either :c:func:`ArtmCreateMasterComponent` or :c:func:`ArtmCreateMasterProxy` method.

:param int iterations_count: The number of iterations to perform.
:param const char* invoke_iteration_args:
Serialized :ref:`InvokeIterationArgs` message,
describing the arguments of this operation.

:param int length:
The length in bytes of the *invoke_iteration_args* message.

:return: Returns :c:macro:`ARTM_SUCCESS` value if operation succeeded,
otherwise returns one of the :ref:`error codes <error-codes>`.
Expand Down Expand Up @@ -421,14 +428,18 @@ ArtmInitializeModel
ArtmWaitIdle
------------

.. c:function:: int ArtmWaitIdle(int master_id, int timeout_milliseconds)
.. c:function:: int ArtmWaitIdle(int master_id, int length, const char* wait_idle_args)

Awaits for ongoing iterations.

:param int master_id: The ID of a master component or a master proxy,
returned by either :c:func:`ArtmCreateMasterComponent` or :c:func:`ArtmCreateMasterProxy` method.

:param int timeout_milliseconds: Timeout in milliseconds. Pass *timeout = -1* to allow infinite timeout.
:param const_char* wait_idle_args:
Serialized :ref:`WaitIdleArgs` message,
describing the arguments of this operation.

:param int length: The length in bytes of the *wait_idle_args* message.

:return: Returns :c:macro:`ARTM_SUCCESS` value if operation succeeded,
otherwise returns one of the :ref:`error codes <error-codes>`.
Expand Down
4 changes: 4 additions & 0 deletions docs/ref/cpp_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ You may also apply the following optimizations that should not change the result
This parameter allows you to specify a writable disk location where BigARTM can cache Theta matrix
between iterations to avoid storing it in main memory.

* ``--merger_queue_size`` limits the size of the merger queue. Decrease the size of the queue might
reduce memory usage, but decrease CPU utilization of the processors.

.. code-block:: bash

>cpp_client --help
Expand Down Expand Up @@ -88,6 +91,7 @@ You may also apply the following optimizations that should not change the result
--parsing_format arg (=0) parsing format (0 - UCI, 1 - matrix
market)
--disk_cache_folder arg disk cache folder
--merger_queue_size arg size of the merger queue

Networking options (experimental):
--nodes arg endpoints of the remote nodes (enables network
Expand Down
2 changes: 1 addition & 1 deletion docs/ref/cpp_interface.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ MasterComponent
Returns mutable configuration of the master component.
Remember to call :cpp:func:`Reconfigure` to propagate your changes to master component.

.. cpp:function:: void InvokeIteration(int iterations_count)
.. cpp:function:: void InvokeIteration(int iterations_count = 1)

Invokes certain number of iterations.

Expand Down
69 changes: 68 additions & 1 deletion docs/ref/messages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,8 @@ Represents a configuration of a perplexity score.
optional string stream_name = 2 [default = "@global"];
optional Type model_type = 3 [default = UnigramDocumentModel];
optional string dictionary_name = 4;
optional float theta_sparsity_eps = 5 [default = 1e-37];
repeated string theta_sparsity_topic_name = 6;
}

.. attribute:: PerplexityScoreConfig.field_name
Expand Down Expand Up @@ -945,6 +947,9 @@ Represents a result of calculation of a perplexity score.
optional double raw = 2;
optional double normalizer = 3;
optional int32 zero_words = 4;
optional double theta_sparsity_value = 5;
optional int32 theta_sparsity_zero_topics = 6;
optional int32 theta_sparsity_total_topics = 7;
}

.. attribute:: PerplexityScore.value
Expand All @@ -966,6 +971,9 @@ Represents a result of calculation of a perplexity score.
A number of tokens that have zero probability p(w|t,d) in a document.
Such tokens are evaluated based on to unigram document model or unigram colection model.

.. attribute:: PerplexityScore.theta_sparsity_value

A fraction of zero entries in the theta matrix.

.. _SparsityThetaScoreConfig:

Expand Down Expand Up @@ -1853,7 +1861,7 @@ Represents an argument of get score operation.
optional Batch batch = 3;
}

.. attribute:: GetScore ValueArgs.model_name
.. attribute:: GetScoreValueArgs.model_name

The name of the model to retrieved score for.

Expand All @@ -1866,3 +1874,62 @@ Represents an argument of get score operation.
The :ref:`Batch` to calculate the score.
This option is only applicable to cumulative scores.
When not provided the score will be reported for all batches processed since last :c:func:`ArtmInvokeIteration`.


.. _AddBatchArgs:

AddBatchArgs
============

Represents an argument of :c:func:`ArtmAddBatch` operation.

.. code-block:: bash

message AddBatchArgs {
optional Batch batch = 1;
optional int32 timeout_milliseconds = 2;
}

.. attribute:: AddBatchArgs.batch

The :ref:`Batch` to add.

.. attribute:: AddBatchArgs.timeout_milliseconds

Timeout in milliseconds for this operation.


.. _InvokeIterationArgs:

InvokeIterationArgs
===================

Represents an argument of :c:func:`ArtmInvokeIteration` operation.

.. code-block:: bash

message InvokeIterationArgs {
optional int32 iterations_count = 1 [default = 1];
}

.. attribute:: InvokeIterationArgs.iterations_count

An integer value describing how many iterations to invoke.


.. _WaitIdleArgs:

WaitIdleArgs
============

Represents an argument of :c:func:`ArtmWaitIdle` operation.

.. code-block:: bash

message WaitIdleArgs {
optional int32 timeout_milliseconds = 1 [default = -1];
}

.. attribute:: WaitIdleArgs.timeout_milliseconds

Timeout in milliseconds for this operation.

0 comments on commit 4106ea5

Please sign in to comment.