本文整理汇总了Python中nengo.spa.Vocabulary.include_pairs方法的典型用法代码示例。如果您正苦于以下问题:Python Vocabulary.include_pairs方法的具体用法?Python Vocabulary.include_pairs怎么用?Python Vocabulary.include_pairs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nengo.spa.Vocabulary
的用法示例。
在下文中一共展示了Vocabulary.include_pairs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_include_pairs
# 需要导入模块: from nengo.spa import Vocabulary [as 别名]
# 或者: from nengo.spa.Vocabulary import include_pairs [as 别名]
def test_include_pairs(rng):
v = Vocabulary(10, rng=rng)
v['A']
v['B']
v['C']
assert v.key_pairs is None
v.include_pairs = True
assert v.key_pairs == ['A*B', 'A*C', 'B*C']
v.include_pairs = False
assert v.key_pairs is None
v.include_pairs = True
v['D']
assert v.key_pairs == ['A*B', 'A*C', 'B*C', 'A*D', 'B*D', 'C*D']
v = Vocabulary(12, include_pairs=True)
v['A']
v['B']
v['C']
assert v.key_pairs == ['A*B', 'A*C', 'B*C']
示例2: test_include_pairs
# 需要导入模块: from nengo.spa import Vocabulary [as 别名]
# 或者: from nengo.spa.Vocabulary import include_pairs [as 别名]
def test_include_pairs():
v = Vocabulary(10)
v["A"]
v["B"]
v["C"]
assert v.key_pairs is None
v.include_pairs = True
assert v.key_pairs == ["A*B", "A*C", "B*C"]
v.include_pairs = False
assert v.key_pairs is None
v.include_pairs = True
v["D"]
assert v.key_pairs == ["A*B", "A*C", "B*C", "A*D", "B*D", "C*D"]
v = Vocabulary(12, include_pairs=True)
v["A"]
v["B"]
v["C"]
assert v.key_pairs == ["A*B", "A*C", "B*C"]