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

Clarify config_generator usage on custom and supported datasets #75

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
20 changes: 14 additions & 6 deletions docs/user_guide/command_line_interface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ marius_config_generator
^^^^^^^^^^^^^^^^^^^^^^^

This command lets users to create a Marius configuration file from the command line with
some parameters specified according to their needs.
some parameters specified according to their needs. Options are provided for generating
Marius configuration files for both custom (``--stats``) and supported datasets (``--dataset``).
This command can be called with:

::
Expand Down Expand Up @@ -289,18 +290,25 @@ The available options:
\-\-data_directory <data_directory>
+++++++++++++++++++++++++++++++++++
``--data_directory`` is an **optional** argument. It specifies the directory where ``marius_preprocess`` stores
preprocessed data.
preprocessed data.

\-\-dataset <dataset>, \-d <dataset>
++++++++++++++++++++++++++++++++++++
``--dataset`` is an **optional** argument. It specifies the name of the supported dataset. It should not be
used when ``--stats`` is in use.
``--dataset`` is an **optional** argument. This argument is used when users want to
generate a Marius configuration file for a supported dataset.
AnzeXie marked this conversation as resolved.
Show resolved Hide resolved
It specifies the name of the supported dataset which its configuration file will be generated.
It should not be used when ``--stats`` is in use. To see which datasets are supported by Marius, check out
:ref:`dataset` table.

\-\-stats <num_nodes> <num_relations> <num_train> <num_valid> <num_test>, \-s <num_nodes> <num_relations> <num_train> <num_valid> <num_test>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
``--stats <num_nodes> <num_relations> <num_train> <num_valid> <num_test>, -s <num_nodes> <num_relations> <num_train> <num_valid> <num_test>``
is an **optional** argument. It specifies the stats of the dataset to be trained over. It should not be used at the same
time with option ``--dataset``.
is an **optional** argument.
This argument is used when users want to generate a Marius configuration file for
a custom dataset. Users need to manually pass the statistics of the dataset in the order of
number of nodes, number of relations, number of edges in training set, number of edges in validation set,
number of edges in testing set.
It should not be used at the same time with option ``--dataset``.

\-\-device <device>, \-dev <device>
+++++++++++++++++
Expand Down
4 changes: 3 additions & 1 deletion docs/user_guide/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ Training embeddings on such a graph requires three steps:

Marius also offers ``marius_config_generator`` to generate a configuration file
for the users given the basic information of dataset statistics and where to store
the created configuration file.
the created configuration file. ``marius_config_generator`` can be used to generate
configuration files for both custom and supported datasets by passing different
options.
AnzeXie marked this conversation as resolved.
Show resolved Hide resolved
All other configuration parameters will be set to the default value.
Users are given the options to specify the values of certain parameters.
The following command shows how to use ``marius_config_generator`` to generate
Expand Down
12 changes: 7 additions & 5 deletions src/python/tools/config_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,25 +130,27 @@ def set_args():
'[--<section>.<key>=<value>]'))
mode = parser.add_mutually_exclusive_group()
parser.add_argument('output_directory', metavar='output_directory',
type=str, help='Directory to put configs \nAlso ' +
type=str, help='Directory to save Marius ' +
'configuration files \nAlso ' +
'assumed to be the default directory of preprocessed' +
' data if --data_directory is not specified')
parser.add_argument('--data_directory', metavar='data_directory',
type=str, help='Directory of the preprocessed data')
mode.add_argument('--dataset', '-d', metavar='dataset', type=str,
help='Dataset to preprocess')
help='Name of the supported dataset for generating ' +
'Marius configuration file')
mode.add_argument('--stats', '-s',
metavar=('num_nodes', 'num_relations', 'num_train',
'num_valid', 'num_test'),
nargs=5, help='Dataset statistics\n' +
nargs=5, help='Custom Dataset statistics\n' +
'Enter in order of num_nodes, num_relations, num_train' +
' num_valid, num_test')
parser.add_argument('--device', '-dev', metavar='generate_config',
choices=["GPU", "CPU", "multi-GPU"],
nargs='?', default='GPU',
help=('Generates configs for a single-GPU/multi-CPU' +
'/multi-GPU training configuration file by ' +
'default. \nValid options (default to GPU): ' +
'/multi-GPU Marius configuration file' +
'. \nValid options (default to GPU): ' +
'[GPU, CPU, multi-GPU]'))

config_dict, valid_dict = read_template(DEFAULT_CONFIG_FILE)
Expand Down