input = Matrix::quick([ [1.0, 2.5], [0.1, 0.0], [0.002, -6.0], ]); $this->layer = new Placeholder1D(3); } /** * @test */ public function build() : void { $this->assertInstanceOf(Placeholder1D::class, $this->layer); $this->assertInstanceOf(Input::class, $this->layer); $this->assertInstanceOf(Layer::class, $this->layer); } /** * @test */ public function forwardInfer() : void { $this->assertEquals(3, $this->layer->width()); $expected = [ [1.0, 2.5], [0.1, 0.0], [0.002, -6.0], ]; $forward = $this->layer->forward($this->input); $this->assertInstanceOf(Matrix::class, $forward); $this->assertEquals($expected, $forward->asArray()); $infer = $this->layer->infer($this->input); $this->assertInstanceOf(Matrix::class, $infer); $this->assertEquals($expected, $infer->asArray()); } }