Esempio n. 1
0
from jactorch.utils.meta import as_numpy
from jactorch.utils.meta import as_tensor
from difflogic.tqdm_utils import tqdm_for

TASKS = ['final', 'stack', 'nlrl-Stack', 'nlrl-Unstack', 'nlrl-On', 'sort', 'path']

parser = JacArgumentParser()

parser.add_argument(
    '--model',
    default='dlm',
    choices=['nlm', 'memnet', 'dlm'],
    help='model choices, nlm: Neural Logic Machine, memnet: Memory Networks, dlm: Differentiable Logic Machine')

# NLM parameters, works when model is 'nlm'.
nlm_group = parser.add_argument_group('Neural Logic Machines')
DifferentiableLogicMachine.make_nlm_parser(
    nlm_group, {
        'depth': 7,
        'breadth': 3,
        'exclude_self': True,
        'logic_hidden_dim': []
    },
    prefix='nlm')
nlm_group.add_argument(
    '--nlm-attributes',
    type=int,
    default=8,
    metavar='N',
    help='number of output attributes in each group of each layer of the LogicMachine'
)
Esempio n. 2
0
TASKS = [
    'outdegree', 'connectivity', 'adjacent', 'adjacent-mnist', 'has-father',
    'has-sister', 'grandparents', 'uncle', 'maternal-great-uncle'
]

parser = JacArgumentParser()

parser.add_argument(
    '--model',
    default='nlm',
    choices=['nlm', 'memnet'],
    help='model choices, nlm: Neural Logic Machine, memnet: Memory Networks')

# NLM parameters, works when model is 'nlm'
nlm_group = parser.add_argument_group('Neural Logic Machines')
LogicMachine.make_nlm_parser(nlm_group, {
    'depth': 4,
    'breadth': 3,
    'exclude_self': True,
    'logic_hidden_dim': []
},
                             prefix='nlm')
nlm_group.add_argument(
    '--nlm-attributes',
    type=int,
    default=8,
    metavar='N',
    help=
    'number of output attributes in each group of each layer of the LogicMachine'
)
Esempio n. 3
0
                    metavar='M',
                    help='skip optim step if grad beyond this number')

parser.add_argument('--solution-count',
                    type=int,
                    default=5,
                    metavar='M',
                    help='number at which to cap target-set')

parser.add_argument('--model',
                    default='nlm',
                    choices=['nlm', 'rrn'],
                    help='model choices, nlm: Neural Logic Machine')

# NLM parameters, works when model is 'nlm'
nlm_group = parser.add_argument_group('Neural Logic Machines')
LogicMachine.make_nlm_parser(nlm_group, {
    'depth': 4,
    'breadth': 2,
    'exclude_self': True,
    'logic_hidden_dim': []
},
                             prefix='nlm')

nlm_group.add_argument(
    '--nlm-attributes',
    type=int,
    default=8,
    metavar='N',
    help=
    'number of output attributes in each group of each layer of the LogicMachine'