Skip to content

Commit dfb8712

Browse files
committed
embryo test
1 parent 8870cb4 commit dfb8712

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

neurallogic/hard_not.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
def differentiable_hard_not(input, weights):
2-
return 1 - weights + input (2 * weights - 1)
2+
return 1 - weights + input * (2 * weights - 1)

setup.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from setuptools import find_packages, setup
2+
setup(
3+
name='neurallogic',
4+
packages=find_packages(include=['neurallogic']),
5+
version='0.1.0',
6+
description='A Neural Logic Library',
7+
author='@z80coder',
8+
install_requires=[],
9+
setup_requires=['pytest-runner'],
10+
test_suite='tests',
11+
)

tests/test_hard_not.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from neurallogic import differentiable_hard_not
1+
import pytest
2+
from neurallogic import hard_not
23

34
def test_differentiable_hard_not():
4-
assert differentiable_hard_not([0.1, 0.5], [0.8, 0.3]) == [0.0, 0.0]
5+
assert hard_not.differentiable_hard_not(0.1, 0.6) == pytest.approx(0.42)

0 commit comments

Comments
 (0)