Browse Source

rename stuff and add a couple missing imports

master
Connor Olding 2 years ago
parent
commit
c81ce0afbb
18 changed files with 20 additions and 18 deletions
  1. 1
    1
      mnist_example.py
  2. 4
    4
      onn/__init__.py
  3. 1
    1
      onn/activation.py
  4. 0
    0
      onn/float.py
  5. 1
    1
      onn/layer.py
  6. 1
    1
      onn/layer_base.py
  7. 1
    1
      onn/learner.py
  8. 1
    1
      onn/loss.py
  9. 3
    2
      onn/model.py
  10. 0
    0
      onn/nodal.py
  11. 2
    1
      onn/optimizer.py
  12. 1
    1
      onn/optimizer_base.py
  13. 1
    1
      onn/parametric.py
  14. 1
    1
      onn/regularizer.py
  15. 1
    1
      onn/ritual.py
  16. 1
    1
      onn/ritual_base.py
  17. 0
    0
      onn/utility.py
  18. 0
    0
      onn/weight.py

+ 1
- 1
mnist_example.py View File

@@ -1,7 +1,7 @@
#!/usr/bin/env python3

from onn import *
from onn.floats import *
from onn.float import *
from dotmap import DotMap

lower_priority()

+ 4
- 4
onn/__init__.py View File

@@ -5,20 +5,20 @@
# this is gonna take some work.

from .activation import *
from .floats import *
from .float import *
from .initialization import *
from .layer import *
from .learner import *
from .loss import *
from .math import *
from .model import *
from .nodes import *
from .nodal import *
from .optimizer import *
from .parametric import *
from .regularizer import *
from .ritual import *
from .util import *
from .weights import *
from .utility import *
from .weight import *

# this is similar to default behaviour of having no __all__ variable at all,
# but ours ignores modules as well. this allows for `import sys` and such

+ 1
- 1
onn/activation.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 .floats import *
from .float import *
from .layer_base import *

class Identity(Layer):

onn/floats.py → onn/float.py View File


+ 1
- 1
onn/layer.py View File

@@ -1,6 +1,6 @@
from .layer_base import *
from .initialization import *
from .floats import *
from .float import *

# Nonparametric Layers {{{1


+ 1
- 1
onn/layer_base.py View File

@@ -2,7 +2,7 @@ import numpy as np

from collections import defaultdict, OrderedDict

from .weights import *
from .weight import *

# used for numbering layers like Keras:
_layer_counters = defaultdict(lambda: 0)

+ 1
- 1
onn/learner.py View File

@@ -1,4 +1,4 @@
from .floats import *
from .float import *
from .optimizer_base import *

class Learner:

+ 1
- 1
onn/loss.py View File

@@ -1,6 +1,6 @@
import numpy as np

from .floats import *
from .float import *

class Loss:
def forward(self, p, y):

+ 3
- 2
onn/model.py View File

@@ -1,8 +1,9 @@
import sys

from .floats import *
from .nodes import *
from .float import *
from .nodal import *
from .layer_base import *
from .utility import *

class Model:
def __init__(self, nodes_in, nodes_out, loss=None, mloss=None, unsafe=False):

onn/nodes.py → onn/nodal.py View File


+ 2
- 1
onn/optimizer.py View File

@@ -1,7 +1,8 @@
import numpy as np

from .floats import *
from .float import *
from .optimizer_base import *
from .utility import *

# some of the the following optimizers are blatantly lifted from tiny-dnn:
# https://github.com/tiny-dnn/tiny-dnn/blob/master/tiny_dnn/optimizers/optimizer.h

+ 1
- 1
onn/optimizer_base.py View File

@@ -1,6 +1,6 @@
import numpy as np

from .floats import *
from .float import *

class Optimizer:
def __init__(self, lr=0.1):

+ 1
- 1
onn/parametric.py View File

@@ -1,6 +1,6 @@
import numpy as np

from .floats import *
from .float import *
from .layer_base import *
from .initialization import *


+ 1
- 1
onn/regularizer.py View File

@@ -1,6 +1,6 @@
import numpy as np

from .floats import *
from .float import *

class Regularizer:
pass

+ 1
- 1
onn/ritual.py View File

@@ -1,6 +1,6 @@
import numpy as np

from .floats import *
from .float import *
from .initialization import *
from .ritual_base import *


+ 1
- 1
onn/ritual_base.py View File

@@ -1,7 +1,7 @@
import types
import numpy as np

from .floats import *
from .float import *

class Ritual: # i'm just making up names at this point.
def __init__(self, learner=None):

onn/util.py → onn/utility.py View File


onn/weights.py → onn/weight.py View File


Loading…
Cancel
Save