#340·synaptic

possible error in layer connection and ALL_TO_ELSE

Author: iholgadoCreated Mar 5, 2019Updated Mar 5, 2019

Hi,

In Layer Connection, I don't undestant the line if(this.type == Layer.connectionType.ALL_TO_ELSE && from == to)

because from and to are Neuron objects in two differente layers. Maybe the code must be if(this.type == Layer.connectionType.ALL_TO_ELSE && here == there) ??

The original code was:

if (this.type == Layer.connectionType.ALL_TO_ALL ||
  this.type == Layer.connectionType.ALL_TO_ELSE) {
  for (var here in this.from.list) {
    for (var there in this.to.list) {
      var from = this.from.list[here];
      var to = this.to.list[there];
      if(this.type == Layer.connectionType.ALL_TO_ELSE && from == to)
        continue;
      var connection = from.project(to, weights);
      this.connections[connection.ID] = connection;
      this.size = this.list.push(connection);
    }
  }

Thanks,