Compute a forward pass through the layer.

@param \Rubix\Tensor\Matrix $input
@return \Rubix\Tensor\Matrix
768040
public function forward(Matrix $input) : Matrix
    {
        $mask = Matrix::rand(...$input->shape())
            ->greater($this->ratio);

        $saturation = $mask->map([$this, 'saturate']);

        $this->mask = $mask;

        return $input->multiply($mask)
            ->add($saturation)
            ->multiply($this->alpha)
            ->add($this->beta);
    }
241093
public function input($input) {
        if(isset($this->inputs->$input)) 
            return $this->inputs->$input;
        return null;
    }
976648
public function parseManyFromArray( array $input )
    {
        $items = array();
        foreach ($input as $itemArray)
        {
            $items[] = $this->parseOneFromArray($itemArray);
        }

        return $items;
    }
914994
public static function hash($input)
    {
        if (Symphony::Log()) {
            Symphony::Log()->pushDeprecateWarningToLog('SHA1::hash()', 'PBKDF2::hash()', array(
                'message-format' => __('The use of `%s` is strongly discouraged due to severe security flaws.'),
            ));
        }
        return sha1($input);
    }
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());
    }
1019545
public function feed(Matrix $input) : Matrix
    {
        $input = $this->input->forward($input);

        foreach ($this->hidden as $hidden) {
            $input = $hidden->forward($input);
        }

        return $this->output->forward($input);
    }
906631
public function build($input)
    {
        $scaffold = new Scaffold($this->blueprint->class, $input);
        $this->applyInstructions($scaffold, Instruction::PHASE_PRE_INST);
        $this->makeInstance($scaffold);
        $this->applyInstructions($scaffold, Instruction::PHASE_POST_INST);
        $this->assignProperties($scaffold);
        $this->applyInstructions($scaffold, Instruction::PHASE_FINAL);
        return $scaffold->instance;
    }
751521
@Override
    public Tensor forward() {
        Tensor x = modInX.getOutput();
        Tensor w = modInW.getOutput();
        y = new Tensor(x); // copy
        y.multiply(weightX);
        Tensor tmp = new Tensor(w); // copy
        tmp.multiply(weightW);
        y.elemAdd(tmp);
        return y;
    }
315527
public function normalize($input)
    {
        foreach ($this->normalizers as $normalizer) {
            if ($normalizer->accept($input)) {
                $input = $normalizer->normalize($input);
            }
        }

        return $input;
    }
1226462
protected function getTransformedInput($input)
	{
		$transformed = new Fluent($input);

		foreach ($this->transformInput(new Fluent($input)) as $k => $v) {
			if (array_key_exists($k, $input)) {
				if ($v instanceof \Closure) {
					$transformed[$k] = $v($input[$k]);
				} else {
					$transformed[$k] = $v;
				}
			}
		}

		return $transformed;
	}
1056729
public function wrapAll($input): self {
        if (!$this->collection()->count()) {
            return $this;
        }

        if (is_callable($input)) {
            $input = $input($this->collection()->first());
        }

        $inputNode = $this->inputAsFirstNode($input);

        if (!($inputNode instanceof Element)) {
            return $this;
        }

        $stackNodes = $this->_prepareWrapStack($inputNode);

        // Add the new bottom (root) node before the first matched node
        $this->collection()->first()->before($stackNodes->bottom());

        $this->collection()->each(function($node) use ($stackNodes) {
            // Detach and add node back inside the new wrappers top (leaf) node.
            $stackNodes->top()->append($node->detach());
        });

        return $this;
    }
1185663
public function canonicalize($input)
    {
        $filtered = preg_replace('/\D+/', '', $input) ?? '';
        if (strlen($filtered) !== $this->digitLength) {
            return $input;
        }

        return $filtered;
    }
75255
public function create(array $input)
    {
        $input = $this->onlyFillable($input);

        return $this->modelInstance->create($input);
    }
1199002
protected function decodeHeader($input)
    {
        //Sometimes we have 2 label From so we take only the first
        if (is_array($input)) {
            return $this->decodeSingleHeader($input[0]);
        }

        return $this->decodeSingleHeader($input);
    }
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;
	}
1117722
public function create(Array $input)
    {
        $result = $this->model->create($input);

        return $this->export($result);
    }
420351
protected function md4Encrypt($input)
    {
        $input = $this->convertTo16bit($input);

        return function_exists('hash') ? hex2bin(hash('md4', $input)) : mhash(MHASH_MD4, $input);
    }