Skip to content
This repository was archived by the owner on Jul 18, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c307e64
initial version of pipeline for testing VFLenet5, masks not working yet
tkornuta-ibm Apr 10, 2019
78a96ac
Merge branch 'develop' into variational_flow_lenet4
tkornuta-ibm Apr 10, 2019
db6b75b
Merge branch 'develop' into variational_flow_lenet4
tkornuta-ibm Apr 10, 2019
c347296
variational flow 1
tkornuta-ibm Apr 10, 2019
148f76d
VF Lenet5: two flows
tkornuta-ibm Apr 10, 2019
3455679
Added (optional) masking to components calculating statistics: P/R an…
tkornuta-ibm Apr 11, 2019
aae5cf1
First version of predictions joining working
tkornuta-ibm Apr 11, 2019
51e209f
Added joined precision recall
tkornuta-ibm Apr 11, 2019
7acca80
Added flag for using prediction distribution/indices to accuracy
tkornuta-ibm Apr 11, 2019
032949f
Added retain_graph=True for many backward passes - i.e. multiloss tra…
tkornuta-ibm Apr 11, 2019
ca65824
vf with shared convnet and two ff predictors, joined at the end
tkornuta-ibm Apr 11, 2019
6ae3a74
Fixes of P/R component, cleanups of VF LeNet5 pipelines, removed VFLe…
tkornuta-ibm Apr 11, 2019
1f46fbd
VF MNIST cleanups
tkornuta-ibm Apr 11, 2019
ff3f01f
Merge pull request #3 from IBM/variational_flow_lenet5
tkornuta-ibm Apr 12, 2019
35442fe
installation - readme
tkornuta-ibm Apr 12, 2019
c33ada2
Merge branch 'variational_flow_lenet2' into develop
tkornuta-ibm Apr 12, 2019
3efde73
Update README.md
tkornuta-ibm Apr 12, 2019
88dac5b
Update README.md
tkornuta-ibm Apr 12, 2019
ad353c6
Update README.md
tkornuta-ibm Apr 12, 2019
f01dfff
Update README.md
tkornuta-ibm Apr 12, 2019
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
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,44 @@ Each such a stream can consist of several components, including one problem inst

As a result, the training & testing mechanisms are no longer pinned to a specific model or problem, and built-in mechanisms for compatibility checking (handshaking), configuration management & statistics collection facilitate running diverse experiments.

## Mainainers
## Installation

PTP relies on [PyTorch](https://github.com/pytorch/pytorch), so you need to install it first.
Refer to the official installation [guide](https://github.com/pytorch/pytorch#installation) for its installation.
It is easily installable via conda_, or you can compile it from source to optimize it for your machine.

PTP is not (yet) available as a [pip](https://pip.pypa.io/en/stable/quickstart/) package, or on [conda](https://anaconda.org/pytorch/pytorch).
However, we provide the `setup.py` script and recommend to use it for installation.
First please clone the project repository::

```console
git clone git@github.com:IBM/pytorchpipe.git
cd pytorchpipe/
```

Then, install the dependencies by running::

```console
python setup.py install
```

This command will install all dependencies via pip_.

---
**NOTE**

If you plan to develop and introduce changes, please call the following command instead::

```console
python setup.py develop
```

This will enable you to change the code of the existing components/workers and still be able to run them by calling the associated ``ptp-*`` commands.
More in that subject can be found in the following blog post on [dev_mode](https://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode).

---

## Maintainers

A project of the Machine Intelligence team, IBM Research, Almaden.

Expand Down
6 changes: 6 additions & 0 deletions configs/default/components/losses/nll_loss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ num_targets_dims: 1
# Options: NLLLoss | CrossEntropyLoss (NOT OPERATIONAL YET!)
# loss_function: NLLLoss

# When set to True, performs masking of selected samples from batch (LOADED)
use_masking: False

streams:
####################################################################
# 2. Keymappings associated with INPUT and OUTPUT streams.
Expand All @@ -23,6 +26,9 @@ streams:
# Stream containing batch of predictions (INPUT)
predictions: predictions

# Stream containing masks used for masking of selected samples from batch (INPUT)
masks: masks

# Stream containing loss (OUTPUT)
loss: loss

Expand Down
44 changes: 44 additions & 0 deletions configs/default/components/masking/join_masked_predictions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This file defines the default values for the Join Masked Predictions component.

####################################################################
# 1. CONFIGURATION PARAMETERS that will be LOADED by the component.
####################################################################

# List of input stream names, each containing batch of predictions (LOADED)
input_prediction_streams: ''

# List of input stream names, each containing batch of masks (LOADED)
input_mask_streams: ''

# List of word mapping names - those will be loaded from globals (LOADED)
input_word_mappings: ''

streams:
####################################################################
# 2. Keymappings associated with INPUT and OUTPUT streams.
####################################################################

# Stream containing batch of output strings (OUTPUT)
output_strings: output_strings

# Stream containing batch of output indices (OUTPUT)
# WARNING: As performed operations are not differentiable,
# those indices cannot be used for e.g. calculation of loss!!
output_indices: output_indices

globals:
####################################################################
# 3. Keymappings of variables that will be RETRIEVED from GLOBALS.
####################################################################

# Vocabulary used to produce output strings (RETRIEVED)
output_word_mappings: output_word_mappings

####################################################################
# 4. Keymappings associated with GLOBAL variables that will be SET.
####################################################################

####################################################################
# 5. Keymappings associated with statistics that will be ADDED.
####################################################################

40 changes: 40 additions & 0 deletions configs/default/components/masking/string_to_mask.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This file defines the default values for the String To Mask component.

####################################################################
# 1. CONFIGURATION PARAMETERS that will be LOADED by the component.
####################################################################

# Value that will be used when word is out of vocavbulary (LOADED)
# (Mask for that element will be 0 as well)
out_of_vocabulary_value: -1

streams:
####################################################################
# 2. Keymappings associated with INPUT and OUTPUT streams.
####################################################################

# Stream containing input strings (INPUT)
strings: strings

# Stream containing output masks (OUTPUT)
masks: masks

# Stream containing output indices (OUTPUT)
string_indices: string_indices

globals:
####################################################################
# 3. Keymappings of variables that will be RETRIEVED from GLOBALS.
####################################################################

# Vocabulary used to produce masks and indices (RETRIEVED)
word_mappings: word_mappings

####################################################################
# 4. Keymappings associated with GLOBAL variables that will be SET.
####################################################################

####################################################################
# 5. Keymappings associated with statistics that will be ADDED.
####################################################################

11 changes: 11 additions & 0 deletions configs/default/components/publishers/accuracy_statistics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
# 1. CONFIGURATION PARAMETERS that will be LOADED by the component.
####################################################################

# Flag indicating whether prediction are represented as distributions or indices (LOADED)
# Options: True (expects distribution for each preditions)
# False (expects indices (max args))
use_prediction_distributions: True

# When set to True, performs masking of selected samples from batch (LOADED)
use_masking: False

streams:
####################################################################
# 2. Keymappings associated with INPUT and OUTPUT streams.
Expand All @@ -15,6 +23,9 @@ streams:
# Stream containing batch of predictions (INPUT)
predictions: predictions

# Stream containing masks used for masking of selected samples from batch (INPUT)
masks: masks

globals:
####################################################################
# 3. Keymappings of variables that will be RETRIEVED from GLOBALS.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
# 1. CONFIGURATION PARAMETERS that will be LOADED by the component.
####################################################################

# Flag indicating whether prediction are represented as distributions or indices (LOADED)
# Options: True (expects distribution for each preditions)
# False (expects indices (max args))
use_prediction_distributions: True

# Flag indicating whether confusion matrix will be shown (LOADED)
show_confusion_matrix: False

Expand All @@ -13,6 +18,9 @@ show_class_scores: False
# When set to true, will use the provided word mappings as labels (LOADED)
use_word_mappings: False

# When set to True, performs masking of selected samples from batch (LOADED)
use_masking: False

streams:
####################################################################
# 2. Keymappings associated with INPUT and OUTPUT streams.
Expand All @@ -24,6 +32,9 @@ streams:
# Stream containing batch of predictions (INPUT)
predictions: predictions

# Stream containing masks used for masking of selected samples from batch (INPUT)
masks: masks

globals:
####################################################################
# 3. Keymappings of variables that will be RETRIEVED from GLOBALS.
Expand Down
14 changes: 5 additions & 9 deletions configs/mnist/default_mnist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ training:
# optimizer parameters:
optimizer:
name: Adam
lr: 0.01
lr: 0.0001
# settings parameters
terminal_conditions:
loss_stop: 1.0e-2
loss_stop: 0.05
episode_limit: 10000
epoch_limit: 10

Expand Down Expand Up @@ -45,20 +45,16 @@ pipeline:
# Loss
nllloss:
type: NLLLoss
priority: 10
priority: 10.0

# Statistics.
batch_size:
type: BatchSizeStatistics
priority: 100.1

accuracy:
type: AccuracyStatistics
priority: 100.2
priority: 100.0

precision_recall:
type: PrecisionRecallStatistics
priority: 100.3
priority: 100.1
use_word_mappings: True
show_class_scores: True
globals:
Expand Down
2 changes: 1 addition & 1 deletion configs/mnist/mnist_classification_convnet_softmax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pipeline:

# Image classifier.
classifier:
type: SoftmaxClassifier
type: FeedForwardNetwork
priority: 3
streams:
inputs: reshaped_maps
Expand Down
Loading