Browse Source

[ENH] simplify quick start

pull/1/head
troyyyyy 2 years ago
parent
commit
a95963ab4c
3 changed files with 7 additions and 9 deletions
  1. +3
    -4
      README.md
  2. +3
    -4
      docs/Intro/Quick-Start.rst
  3. +1
    -1
      examples/mnist_add/datasets/get_dataset.py

+ 3
- 4
README.md View File

@@ -80,9 +80,8 @@ In the MNIST Addition task, the data loading looks like:
from datasets import get_dataset
# train_data and test_data are tuples in the format (X, gt_pseudo_label, Y)
# If get_pseudo_label is set to False, the gt_pseudo_label in each tuple will be None.
train_data = get_dataset(train=True, get_pseudo_label=True)
test_data = get_dataset(train=False, get_pseudo_label=True)
train_data = get_dataset(train=True)
test_data = get_dataset(train=False)
```

### Building the Learning Part
@@ -148,7 +147,7 @@ ABL-Package provides two basic metrics, namely `SymbolAccuracy` and `ReasoningMe
```python
from abl.data.evaluation import ReasoningMetric, SymbolAccuracy
metric_list = [SymbolAccuracy(prefix="mnist_add"), ReasoningMetric(kb=kb, prefix="mnist_add")]
metric_list = [SymbolAccuracy(), ReasoningMetric(kb=kb)]
```

### Bridging Learning and Reasoning


+ 3
- 4
docs/Intro/Quick-Start.rst View File

@@ -25,9 +25,8 @@ In the MNIST Addition task, the data loading looks like
from datasets import get_dataset
# train_data and test_data are tuples in the format (X, gt_pseudo_label, Y)
# If get_pseudo_label is set to False, the gt_pseudo_label in each tuple will be None.
train_data = get_dataset(train=True, get_pseudo_label=True)
test_data = get_dataset(train=False, get_pseudo_label=True)
train_data = get_dataset(train=True)
test_data = get_dataset(train=False)

Read more about `preparing datasets <Datasets.html>`_.

@@ -105,7 +104,7 @@ ABL-Package provides two basic metrics, namely ``SymbolAccuracy`` and ``Reasonin

from abl.data.evaluation import ReasoningMetric, SymbolAccuracy

metric_list = [SymbolAccuracy(prefix="mnist_add"), ReasoningMetric(kb=kb, prefix="mnist_add")]
metric_list = [SymbolAccuracy(), ReasoningMetric(kb=kb)]

Read more about `building evaluation metrics <Evaluation.html>`_



+ 1
- 1
examples/mnist_add/datasets/get_dataset.py View File

@@ -5,7 +5,7 @@ from torchvision.transforms import transforms

CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))

def get_dataset(train=True, get_pseudo_label=False):
def get_dataset(train=True, get_pseudo_label=True):
transform = transforms.Compose(
[transforms.ToTensor(), transforms.Normalize((0.1307,), (0.3081,))]
)


Loading…
Cancel
Save