Skip to content

Instantly share code, notes, and snippets.

# PhysicsFixed.py; revert to Aquarium2.py
# Untested, but in place:
# Advance to training the cybernetics connecting sensors to neurons to motors;
# Try testing for motor activations that tend to reduce angle and distance to target.
# Reassign network connections when they are maintained near 0 weight after multiple
# opportunities to update.
# Agents will reproduce when they have accumulated sufficiently many primitives
# to constitute the new structure; new structure will be modified by random adjustment of all relevant
@mebedavis
mebedavis / SometimesReassignsProductively.py
Created March 3, 2025 16:58
Basic learning algorithm implemented on an evolvable biomimetic substrate. Currently failing to reassign connections productively, but at least does not destroy a bespoke optimal map — though it suppressed motor activation while outperforming my design, which is very mysterious right now.
# revert to atleastnotdestructive
# Current training method at least does not destroy the bespoke network,
# but with random initial map, connections do not reassign productively
# or else acquire sufficient weight to become fixed or something.
# Advance to training the cybernetics connecting sensors to neurons to motors;
# Try testing for motor activations that tend to reduce angle and distance to target.
# Reassign network connections when they are maintained near 0 weight after multiple
# opportunities to update.
# TrainingTake3.py Based on cybernetics.py Training method appears to work but is counterproductive
# owing possibly to distance changes lagging too far behind motor inputs.
# Advance to TrainingTake3.py to try predicting negative deltas on angle to
# target instead.
# Revert to TrainingTake2.py; construct network updates and valid tests of success.
# Diagnose whether or not network updates including reassignment are effective.
# Advance to training the cybernetics connecting sensors to neurons to motors;
# Try testing for motor activations that tend to reduce angle and distance to target.
# RudimentaryTraining.py. Revert to TrainingMethod.py
# TrainingMethod resulted in ostensibly correct connection weight adjustments
# to penalize counterproductive connection assignments and augment good ones
# based on comparative target acquisition compared to baselines for optimal (21 acquired),
# severly wall-eyed (14), and trained by the method from random assignment (16).
# Deficit from optimal network map hypothetically explained by the mere fact that some
# connections now return zero, being suboptimally connected, and therefore debit total
# motor thrust.
@mebedavis
mebedavis / Cybernetics.py
Last active February 23, 2025 18:14
Cybernetics reimplemented and optimal network map demonstrated to be effective.
# Cybernetics.py; revert to BACKUPSentinelDrones.py
# Advance to rebuilding the cybernetics connecting sensors to neurons to motors.
# Vision logic is now totally redundant. I'm iterating over the flat list of primitives to populate a dictionary
# that's now sorted in geometrical order, when I could just be sorting the flast list OR the
# dictionary. It works, so I'm not fucking with it right now, but I should find out which
# is faster and eliminate the other method at some point.
# Rebuild connectome, imposing optimal connections between sensors and neurons, neurons with
@mebedavis
mebedavis / SentinelDrones.py
Last active February 20, 2025 01:40
Dis bish navigates 3-dimensional space well enough to hit moving targets.
# SentinelDrones.py
# Advance to rebuilding the cybernetics connecting sensors to neurons to motors, but first
# refine the test environment by creating the target class and populating the gamespace
# with instances which move to demonstrate the agent consistently interacts with targets.
# Create a collision method to indicate when agents have approached targets within
# some reasonable interaction distance, perhaps d < 5.
# Then, rebuild connectome, imposing optimal connections between sensors and neurons, neurons with
# sensors, motors, and other nerurons, and motors to neurons. This will provide the basis for an
# Revert to FirstRotation_Updated.py. Advance to Aquarium0.5.py with magnified graphics.
# Demonstrated complete rotation on appropriate pitch from vertically opposed motors.
# Next: magnify graphics and depth-scale.
import math
import numpy as np
#import random
import pygame
# Full rotation demonstrated.
# Re-implement sensors and networks.
# Revert to physics4.
import math
import numpy as np
#import random
import pygame
import time
from scipy.spatial.transform import Rotation as R
@mebedavis
mebedavis / Physics4.py
Created February 9, 2025 17:18
Skeleton code for thrust vectoring
# Clean Slate rebuild of the physics core.
# Exists Physics3 backup to revert to.
# Intent is to strip the physics core out of this,
# preserve useful graphics functions, and replace the physics core,
# fully leveraging the rotation math in scipy in hope of solving
# problems with reference frame inversion and other problems with any
# rotation 2pi/4 causing singularities in the quaternion method.
import math
import numpy as np
@mebedavis
mebedavis / Aquarium0.5.py
Last active February 11, 2025 23:45
Skeleton python code for a Digital Life program to explore the possible emergence of consciousness-entailing recurrent neural networks from primitive elements in a realistic physical environment.
# Revert to FirstRotation_Updated.py. Advance to Aquarium0.5.py with magnified graphics.
# Demonstrated complete rotation on appropriate pitch from vertically opposed motors.
# Next: magnify graphics and depth-scale.
import math
import numpy as np
#import random
import pygame