Compute an inferential pass through the layer.

@param \Rubix\Tensor\Matrix $input
@throws \RuntimeException
@return \Rubix\Tensor\Matrix
777234
public function infer(Matrix $input) : Matrix
    {
        if (!$this->mean or !$this->variance or !$this->beta or !$this->gamma) {
            throw new RuntimeException('Layer has not been initilaized.');
        }

        $xHat = $input->subtract($this->mean)
            ->divide($this->variance->clipLower(EPSILON)->sqrt());

        return $this->gamma->w()->multiply($xHat)->add($this->beta->w());
    }
1303211
public function unserialize($input)
    {
        // Unserialize the executable, args, options, data, and inputs.
        list($this->calledScript, $this->args, $this->filter, $this->data, $this->inputs) = unserialize($input);

        $this->filter = $this->filter ?: new NullFilter();
    }
1226771
protected function arrayToConditionDataModel(array $input)
    {
        /** @var \Smile\ElasticsuiteCatalogRule\Model\Data\Condition $conditionDataModel */
        $conditionDataModel = $this->conditionDataFactory->create();
        foreach ($input as $key => $value) {
            switch ($key) {
                case 'type':
                    $conditionDataModel->setConditionType($value);
                    break;
                case 'attribute':
                    $conditionDataModel->setAttributeName($value);
                    break;
                case 'operator':
                    $conditionDataModel->setOperator($value);
                    break;
                case 'value':
                    $conditionDataModel->setValue($value);
                    break;
                case 'aggregator':
                    $conditionDataModel->setAggregatorType($value);
                    break;
                case 'conditions':
                    $conditions = [];
                    foreach ($value as $condition) {
                        $conditions[] = $this->arrayToConditionDataModel($condition);
                    }
                    $conditionDataModel->setConditions($conditions);
                    break;
                default:
            }
        }

        return $conditionDataModel;
    }
509591
public function forward(Matrix $input) : Matrix
    {
        $this->input = $input;

        return $this->compute($input);
    }
661556
public function prepare($input)
    {
        $form = $this->buildEmbeddedForm();

        return $form->setOriginal($this->original)->prepare($input);
    }
159012
public function castInput(array $input, array $metadata=[])
    {

        $casted = $input;

        foreach ($this->chain as $casterName) {
            $result = call_user_func($this->casters[$casterName], $casted);
            $casted = &$result;
        }

        return $casted;

    }
719061
public function get($input) {
    if ($input instanceof Vertice && $this->has($input)) {
      return $this->V[$input->label];
    } elseif (array_key_exists($input, $this->V)) {
      return $this->V[$input];
    } else {
      return NULL;
    }
  }
302773
public function create($input)
	{
		$mapper = $this->getMapper();
		$admin  = $mapper->getAdmin();

		$model      = $this->getModel();
		$primaryKey = (new $model)->getKeyName();

		$this->setInput($input);

		// Field pre update
		foreach ($mapper->getFields() as $field) {
			$field->preUpdate();
			$input = $this->getInput();

			// Is this a multiple field?
			if ($field->isMultiple()) {
				$value = Value::encode(Config::get('bauhaus::admin.multiple-serializer'), $input[$field->getName()]);
				$this->setInputVariable($field->getName(), $value);
			}

			if ($field->hasSaving()) {
				$saving = $field->getSaving();
				$this->setInputVariable($field->getName(), $saving($input[$field->getName()]));
			}
		}

		// Model before create hook
		if (method_exists($admin, 'beforeCreate')) {
			$admin->beforeCreate($input);
		}

		// Validate
		if (property_exists($model, 'rules')) {
			$validator = Validator::make($this->getInput(), $model::$rules);
			if ($validator->fails()) {
				return $validator;
			}
		}

		// Model create hook
		if (method_exists($admin, 'create')) {
			$model = $admin->create($this->getInput());
		} else {
			$model = $model::create($this->getInput());
		}

		// Set the primary id from the `new` model
		$this->setIdentifier($model->{$primaryKey});

		// Field post update
		foreach ($mapper->getFields() as $field) {
			$field->postUpdate($this->getInput());
		}

		// Model after create hook
		if (method_exists($admin, 'afterCreate')) {
			$result = $admin->afterCreate($this->getInput());

			if ($result instanceof \Illuminate\Http\RedirectResponse) {
				$result->send();
			}
		}

		return $this;
	}
837562
private function load($input) {
		$Source = $this->loadFromSource($input);
		if (empty ($Source)) return array();
		$this->path = array();
		$this->result = array();


		for ($i = 0; $i < count($Source); $i++) {
			$line = $Source[$i];
			$lineIndent = $this->_getIndent($line);
			$this->path = $this->getParentPathByIndent($lineIndent);
			$line = $this->stripIndent($line, $lineIndent);
			if ($this->isComment($line)) continue;

			if ($literalBlockStyle = $this->startsLiteralBlock($line)) {
				$line = rtrim ($line, $literalBlockStyle . "\n");
				$literalBlock = '';
				$line .= $this->LiteralPlaceHolder;

				while ($this->literalBlockContinues($Source[++$i], $lineIndent)) {
					$literalBlock = $this->addLiteralLine($literalBlock, $Source[$i], $literalBlockStyle);
				}
				$i--;
			}
			$lineArray = $this->_parseLine($line);
			if ($literalBlockStyle)
			$lineArray = $this->revertLiteralPlaceHolder ($lineArray, $literalBlock);

			$this->addArray($lineArray, $lineIndent);
		}
		return $this->result;
	}
530697
public function run( $input )
	{
		$this->state = $this->start;
		$this->pointer = 0;
		$output = $input;
		$this->wrapTape( $output );
		while( !in_array( $this->state, $this->finals ) )
		{
			if( $_counter > 200 )
				break;
			$_counter++;
			$_current = $this->getCurrent( $output, $this->pointer );
			reset( $this->transition );
			foreach( $this->transition as $trans )
			{
				if( $trans[0] == array( $this->state, $_current ) )
				{
					$value = $trans[1];
					$state = $value[0];
					$this->state = $state;
					$write = $value[1];
					$left = substr( $output, 0, $this->pointer );
					$right = substr( $output, $this->pointer+1 );
					$output = $left.$write.$right;
					$direction = $value[2];
					if( $direction == "l" )
						$this->pointer--;
					else if( $direction == "r" )
						$this->pointer++;
					$this->extendTape( $output, $this->pointer );
					$this->wrapTape( $output );
					break;
				}
			}
			echo $this->showTape( $output );
		}
		$this->cleanTape( $output );
		return $output;
	}
949836
public static function toReadMap($input)
    {
        Arguments::define(Boa::readMap())->check($input);

        if ($input instanceof ReadMapInterface) {
            return $input;
        }

        if (is_array($input)
            || $input instanceof ArrayObject
            || $input instanceof ArrayAccess
        ) {
            return static::toMap($input);
        }

        if ($input instanceof Traversable) {
            return new TraversableLeftFoldable($input);
        }

        throw new CoreException('Unable to build ReadMap');
    }
1302873
public static function cast( $input, ?array $default = null, bool $deep = false ): ?array {
    if( !static::is( $input, true ) ) return $default;
    else {

      // handle simple cases to speed up the process
      if( !$deep ) {
        if( is_array( $input ) ) return $input;
        else if( $input instanceof \StdClass ) return (array) $input;
        else if( $input instanceof StorageInterface ) return $input->getArray( '' );
      }

      $tmp = [];
      foreach( $input as $k => $t ) {
        $tmp[ $k ] = $deep && static::is( $t, true ) ? static::cast( $t, null, $deep ) : $t;
      }

      return $tmp;
    }
  }
315527
public function normalize($input)
    {
        foreach ($this->normalizers as $normalizer) {
            if ($normalizer->accept($input)) {
                $input = $normalizer->normalize($input);
            }
        }

        return $input;
    }
746889
public function tokenize($input)
	{
		$tokens = [];
		$exp = ltrim($input);
		
		for($length = strlen($exp), $i = 0; $i < $length; $i++)
		{
			if(trim($exp[$i]) == '')
			{
				continue;
			}
			
			if(NULL !== ($token = $this->getTerminalToken($exp, $i)))
			{
				$tokens[] = $token;
				
				continue;
			}
			
			if(NULL !== ($token = $this->getStringToken($exp, $length, $i)))
			{
				$tokens[] = $token;
				
				continue;
			}
			
			$sub = substr($exp, $i);
			$m = NULL;
			
			if(preg_match(self::PATTERN_DECIMAL, $sub, $m))
			{
				$tokens[] = $this->getDecimalToken($m);
				$i += strlen($m[1]) - 1;
				
				continue;
			}
			
			if(preg_match(self::PATTERN_INTEGER, $sub, $m))
			{
				$tokens[] = $this->getIntegerToken($m);	
				$i += strlen($m[1]) - 1;
				
				continue;
			}
			
			if(preg_match(self::PATTERN_IDENTIFIER, $sub, $m))
			{
				$tokens[] = $this->getIdentifierToken($m);
				$i += strlen($m[0]) - 1;
				
				continue;
			}
		}
		
		return new AnnotationTokenSequence($tokens);
	}
80830
public function write($input)
    {
        if (null === $input) {
            return;
        }
        if ($this->isClosed()) {
            throw new RuntimeException(sprintf('%s is closed', static::class));
        }
        $this->input[] = ProcessUtils::validateInput(__METHOD__, $input);
    }
851834
private function convert($input)
    {
        if (is_array($data = json_decode($input, true))) {
            if (array_key_exists('signatures', $data) || array_key_exists('recipients', $data)) {
                return $data;
            } elseif (array_key_exists('signature', $data)) {
                return $this->fromFlattenedSerializationSignatureToSerialization($data);
            } elseif (array_key_exists('ciphertext', $data)) {
                return $this->fromFlattenedSerializationRecipientToSerialization($data);
            }
        } elseif (is_string($input)) {
            return $this->fromCompactSerializationToSerialization($input);
        }

        throw new \InvalidArgumentException('Unsupported input');
    }
68586
public function keyToValue(array $input)
    {
        $output = array();

        foreach ($input as $key => $value) {
            $output[] = array($key, $value);
        }

        return $output;
    }