Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add config loader and store method #23

Merged
merged 8 commits into from
May 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 14 additions & 20 deletions conex/nn/Modules/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def __init__(
self.network = net
net.input_layers.append(self)

sensory_tag = "Sensory" if sensory_tag is None else "Sensory," + sensory_tag
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure that no errors or issues will be encountered in this format. using underline rather than comma is safer in my opinion.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nein. (add_tag process this tag(made of comma-separated tags))


if have_sensory:
self.sensory_pop = self.__get_ng(
net,
Expand All @@ -62,13 +64,12 @@ def __init__(
sensory_user_defined,
)

if sensory_tag is None:
self.sensory_pop.tags.insert(0, "Sensory")
else:
self.sensory_pop.add_tag("Sensory")

self.sensory_pop.layer = self

location_tag = (
"Location" if location_tag is None else "Location," + location_tag
)

if have_location:
self.location_pop = self.__get_ng(
net,
Expand All @@ -79,11 +80,6 @@ def __init__(
location_user_defined,
)

if location_tag is None:
self.location_pop.tags.insert(0, "Location")
else:
self.location_pop.add_tag("Location")

self.location_pop.layer = self

def connect(
Expand Down Expand Up @@ -158,6 +154,12 @@ def __init__(
self.network = net
net.output_layers.append(self)

representation_tag = (
"Representation"
if representation_tag is None
else "Representation," + representation_tag
)

if representation_size is not None:
self.representation_pop = self.__get_ng(
net,
Expand All @@ -168,13 +170,10 @@ def __init__(
representation_user_defined,
)

if representation_tag is None:
self.representation_pop.tags.insert(0, "Representation")
else:
self.representation_pop.add_tag("Representation")

self.representation_pop.layer = self

motor_tag = "Motor" if motor_tag is None else "Motor," + motor_tag

if motor_size is not None:
self.motor_pop = self.__get_ng(
net,
Expand All @@ -185,11 +184,6 @@ def __init__(
motor_user_defined,
)

if motor_tag is None:
self.motor_pop.tags.insert(0, "Motor")
else:
self.motor_pop.add_tag("Motor")

self.motor_pop.layer = self

self.add_tag(self.__class__.__name__)
Expand Down