toWeighted method

Map<T, num> toWeighted()

Implementation

Map<T, num> toWeighted() {
  if (T is Node) {
    var nodes = cast<Node>();
    var weightedMap = <Node, num>{};
    for (var n in nodes) {
      weightedMap[n] = Activation.sigmoid(-n.depth);
    }
    return weightedMap.cast<T, num>();
  } else {
    throw ArgumentError(T.toString() + " is not a subtype of Node");
  }
}