fix __name__ being incorrect due to extra __all__

this fixes tracebacks and checks for __main__,
among other things.
This commit is contained in:
Connor Olding 2018-03-17 14:09:15 +01:00
parent ec71d4956e
commit 7161f983ab
14 changed files with 12 additions and 16 deletions

1
.gitignore vendored
View file

@ -4,4 +4,3 @@ __pycache__
# work in progress:
onn/component.py
onn/extra.py
onn/run.py

View file

@ -3,7 +3,7 @@ import numpy as np
# just for speed, not strictly essential:
from scipy.special import expit as sigmoid
from .float import *
from .float import _f, _1
from .layer_base import *

View file

@ -1,6 +1,6 @@
import numpy as np
from .float import *
from .float import _f, _0, _1
from .layer import Layer
from .loss import Loss
from .optimizer import Optimizer

View file

@ -16,6 +16,3 @@ _inv2 = _f(1/2)
_sqrt2 = _f(np.sqrt(2))
_invsqrt2 = _f(1/np.sqrt(2))
_pi = _f(np.pi)
__all__ = [k for k, v in locals().items()
if not __import__('inspect').ismodule(v)]

View file

@ -1,6 +1,6 @@
from .layer_base import *
from .initialization import *
from .float import *
from .float import _f, _1
# Nonparametric Layers {{{1

View file

@ -1,4 +1,4 @@
from .float import *
from .float import _f, _1, _pi, _inv2
from .optimizer_base import *

View file

@ -1,6 +1,6 @@
import numpy as np
from .float import *
from .float import _f
class Loss:

View file

@ -1,6 +1,6 @@
import sys
from .float import *
from .float import _f, _0
from .nodal import *
from .layer_base import *
from .utility import *

View file

@ -1,6 +1,6 @@
import numpy as np
from .float import *
from .float import _f, _0, _1
from .optimizer_base import *
from .utility import *

View file

@ -1,6 +1,6 @@
import numpy as np
from .float import *
from .float import _f
class Optimizer:

View file

@ -1,6 +1,6 @@
import numpy as np
from .float import *
from .float import _f
from .layer_base import *
from .initialization import *

View file

@ -1,7 +1,7 @@
import numpy as np
from .float import _f, _0
from .layer import Layer
from .float import *
class Regularizer:

View file

@ -1,6 +1,6 @@
import numpy as np
from .float import *
from .float import _f
from .initialization import *
from .ritual_base import *

View file

@ -1,7 +1,7 @@
import types
import numpy as np
from .float import *
from .float import _f, _0
class Ritual: # i'm just making up names at this point.