fixed imports

This commit is contained in:
2025-12-19 11:10:16 +01:00
parent a60f802443
commit cadbb34d1a
9 changed files with 28 additions and 28 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
from params import EntityParams from .params import EntityParams
from state import RbmState from .state import RbmState
from matrix import prob, Mat from .matrix import prob, Mat
class Entity: class Entity:
def __init__(self, shape: tuple[int, int], params: EntityParams): def __init__(self, shape: tuple[int, int], params: EntityParams):
+6 -6
View File
@@ -1,9 +1,9 @@
from params import EntityParams from .params import EntityParams
from state import RbmState from .state import RbmState
from status import Status from .status import Status
from train import train from .train import train
from entity import Entity from .entity import Entity
from matrix import Mat, np from .matrix import Mat, np
class Layer: class Layer:
def __init__(self, name: str, shape: tuple[int, int, int, int], params: EntityParams): def __init__(self, name: str, shape: tuple[int, int, int, int], params: EntityParams):
+1 -1
View File
@@ -1,6 +1,6 @@
import os import os
from enum import Enum from enum import Enum
from layer import Layer from .layer import Layer
class StackType(Enum): class StackType(Enum):
Deep = "Deep", Deep = "Deep",
+4 -4
View File
@@ -1,7 +1,7 @@
from status import Status from .status import Status
from train import train from .train import train
from stack import Stack, StackType from .stack import Stack, StackType
from matrix import Mat, np from .matrix import Mat, np
class StackDeep(Stack): class StackDeep(Stack):
def __init__(self, name: str, work_dir: str = '.'): def __init__(self, name: str, work_dir: str = '.'):
+5 -5
View File
@@ -1,10 +1,10 @@
import json import json
from collections.abc import Callable from collections.abc import Callable
from stack import StackType from .stack import StackType
from layer import Layer from .layer import Layer
from params import EntityParams from .params import EntityParams
from stack_deep import StackDeep from .stack_deep import StackDeep
from stack_rnn import StackRnn from .stack_rnn import StackRnn
class StackFactory: class StackFactory:
@classmethod @classmethod
+1 -1
View File
@@ -1,4 +1,4 @@
from stack import Stack, StackType from .stack import Stack, StackType
class StackRnn(Stack): class StackRnn(Stack):
def __init__(self, name: str, work_dir: str = '.'): def __init__(self, name: str, work_dir: str = '.'):
+1 -1
View File
@@ -1,4 +1,4 @@
from matrix import uniform, Mat, np from .matrix import uniform, Mat, np
class RbmState: class RbmState:
def __init__(self, w_hv: Mat, b_v: Mat, b_h: Mat): def __init__(self, w_hv: Mat, b_v: Mat, b_h: Mat):
+4 -4
View File
@@ -1,10 +1,10 @@
import os.path import os.path
import cv2 as cv import cv2 as cv
from argparse import ArgumentParser from argparse import ArgumentParser
from stack_factory import StackFactory from .stack_factory import StackFactory
from status import Status from .status import Status
from stack_deep import StackDeep from .stack_deep import StackDeep
from matrix import Mat, np, convert from .matrix import Mat, np, convert
def cv_show(name: str, vec: Mat, shape): def cv_show(name: str, vec: Mat, shape):
img = cv.Mat(convert(np.resize(vec, shape))) img = cv.Mat(convert(np.resize(vec, shape)))
+3 -3
View File
@@ -1,7 +1,7 @@
from collections.abc import Callable from collections.abc import Callable
from matrix import gaussian, sample, prob, rms_error_accu, Mat, np from .matrix import gaussian, sample, prob, rms_error_accu, Mat, np
from entity import Entity from .entity import Entity
from status import Status from .status import Status
def cd_jens(entity: Entity, v_states: Mat): def cd_jens(entity: Entity, v_states: Mat):
v_probs = prob(v_states) v_probs = prob(v_states)