refactored

This commit is contained in:
2025-12-19 15:20:04 +01:00
parent a293fc31a0
commit a47922cb1c
8 changed files with 92 additions and 124 deletions
+5 -7
View File
@@ -1,15 +1,13 @@
from .params import EntityParams
from .state import RbmState
from .status import Status
from .train import train
from .entity import Entity
from .matrix import Mat, np
from .train import TrainingParams
from .entity import Entity, EntityParams
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], entity_params: EntityParams, training_params: TrainingParams):
self.name = name
self.shape = shape
self.entity = Entity((shape[0]*shape[1]+shape[2], shape[3]), params)
self.entity = Entity((shape[0]*shape[1]+shape[2], shape[3]), entity_params)
self.training_params = training_params
def init(self, std: float):
self.entity.state.init(mu=0, std=std)