Skip to content

Commit

Permalink
added bias as a propargs for users
Browse files Browse the repository at this point in the history
  • Loading branch information
fdnthecoder committed Aug 4, 2021
1 parent 6b8b70e commit 4a41ae3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 6 additions & 2 deletions models/act_in.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
FARTHER_CELLS = "farther_cells"
ACT_STRENGTH = "activation_strengh"
IN_STRENGTH = "inhibition_strengh"
BIAS = "bias"


def get_near_and_far_grps(agent):
Expand All @@ -47,7 +48,8 @@ def group_power(grp, exec_key):

def act_val(act_power, in_power):
return (act_power * act_in_grps[ACTIVE][ACT_STRENGTH]
+ in_power * act_in_grps[INACTIVE][IN_STRENGTH] + DEF_BIAS)
+ in_power * act_in_grps[INACTIVE][IN_STRENGTH] +
act_in_grps[INACTIVE][BIAS])


def act_in_action(agent, **kwargs):
Expand Down Expand Up @@ -92,7 +94,8 @@ def act_in_action(agent, **kwargs):
mdl.NUM_MBRS: DEF_INACTIVE_MBRS,
mdl.NUM_MBRS_PROP: "num_inactive",
mdl.COLOR: RED,
IN_STRENGTH: DEF_IN_STRENGTH
IN_STRENGTH: DEF_IN_STRENGTH,
BIAS: DEF_BIAS,
},
}

Expand All @@ -112,6 +115,7 @@ def handle_props(self, props):
DEF_IN_STRENGTH)
act_in_grps[INACTIVE][ACT_STRENGTH] = self.get_prop(ACT_STRENGTH,
DEF_ACT_STRENGTH)
act_in_grps[INACTIVE][BIAS] = self.get_prop(BIAS, DEF_BIAS)


def create_model(serial_obj=None, props=None, create_for_test=False,
Expand Down
8 changes: 8 additions & 0 deletions models/props/act_in.props.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@
"hival": -0.1,
"lowval": -10
},
"bias": {
"val": 0,
"question": "What's the bias of the cells? inhition< 0 <activation",
"atype": "DBL",
"hival": 10,
"lowval": -10
},

"use_line": {
"val": 0,
"atype": "BOOL"
Expand Down

0 comments on commit 4a41ae3

Please sign in to comment.