<commit_before>export { BoundsArray_ActivationEscaping };

import * as FloatValue from "../../Unpacker/FloatValue.js";
import * as ActivationEscaping from "../ActivationEscaping.js";

/**
 * Element value bounds (per channel) with ActivationEscaping information.
 *
 * The main purpose is to find out the activationEscaping_ScaleArraySet so that it can be used to let channel escape from
 * activation function's non-linear effect.
 *
 *
 *
 * @member {FloatValue.BoundsArray} boundsArray
 *   The element value bounds (per channel).
 *
 * @member {number} channelCount
 *   The channel count of the boundsArray (i.e. this.boundsArray.length).
 *
 * @member {ActivationEscaping.ScaleArraySet} activationEscaping_ScaleArraySet
 *   The scales for moving this.afterBias bounds into the linear domain of the activation function. That is, for
 * letting this.afterBias escape from activation function's non-linear domain. And the .undo for undoing the scales.
 */
class BoundsArray_ActivationEscaping {

  /**
   */
  constructor( channelCount ) {
    this.boundsArray = new FloatValue.BoundsArray( channelCount );
    this.activationEscaping_ScaleArraySet = new ActivationEscaping.ScaleArraySet( channelCount );
  }

  get channelCount() {
    return this.boundsArray.length;
  }

  set channelCount( newChannelCount ) {
    this.boundsArray.length = newChannelCount;
    this.activationEscaping_ScaleArraySet.length = newChannelCount;
  }

  /**
   * @return {InputsOutputs}
   *   Return a newly created InputsOutputs which is a copy of this InputsOutputs. The this.inputs will just past
   * to new InputsOutputs (i.e. NOT copied). But the this.outputs will be copied.
   */
  clone() {
    let result = new BoundsArray_ActivationEscaping( this.channelCount );
    result.set_all_byBoundsArray_ActivationEscaping( this );
    return result;
  }

  /**<commit_msg>Update BoundsArray_ActivationEscaping.js<commit_after>export { BoundsArray_ActivationEscaping };

import * as FloatValue from "../../Unpacker/FloatValue.js";
import * as ActivationEscaping from "../ActivationEscaping.js";

/**
 * Element value bounds (per channel) with ActivationEscaping information.
 *
 * The main purpose is to find out the activationEscaping_ScaleArraySet so that it can be used to let channel escape from
 * activation function's non-linear effect.
 *
 *
 * @member {FloatValue.BoundsArray} boundsArray
 *   The element value bounds (per channel).
 *
 * @member {number} length
 *   The channel count of the boundsArray (i.e. this.boundsArray.length).
 *
 * @member {number} channelCount
 *   The same as .length.
 *
 * @member {ActivationEscaping.ScaleArraySet} activationEscaping_ScaleArraySet
 *   The scales for moving this.afterBias bounds into the linear domain of the activation function. That is, for
 * letting this.afterBias escape from activation function's non-linear domain. And the .undo for undoing the scales.
 */
class BoundsArray_ActivationEscaping {

  /**
   */
  constructor( channelCount ) {
    this.boundsArray = new FloatValue.BoundsArray( channelCount );
    this.activationEscaping_ScaleArraySet = new ActivationEscaping.ScaleArraySet( channelCount );
  }

  get length() {
    return this.boundsArray.length;
  }

  get channelCount() {
    return this.length;
  }

  set length( newLength ) {
    this.boundsArray.length = newLength;
    this.activationEscaping_ScaleArraySet.length = newLength;
  }

  set channelCount( newChannelCount ) {
    this.length = newChannelCount;
  }

  /**
   * @return {InputsOutputs}
   *   Return a newly created InputsOutputs which is a copy of this InputsOutputs. The this.inputs will just past
   * to new InputsOutputs (i.e. NOT copied). But the this.outputs will be copied.
   */
  clone() {
    let result = new BoundsArray_ActivationEscaping( this.channelCount );
    result.set_all_byBoundsArray_ActivationEscaping( this );
    return result;
  }

  /**
{'fraction_non_alphanumeric': 0.08776867963152507, 'fraction_numerical': 0.0, 'mean_word_length': 3.9418457648546146, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '977422', 'n_tokens_mistral': 1147, 'n_tokens_neox': 1095, 'n_words': 343}