Skip to content

Commit

Permalink
Outlined NeuralNet abstraction
Browse files Browse the repository at this point in the history
  • Loading branch information
DreamingRaven committed Jul 14, 2022
1 parent 8f23b36 commit 1bed91b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
34 changes: 34 additions & 0 deletions nn/nn.go
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
package nn

import (
"fmt"
"sync"

"gitlab.com/deepcypher/darklantern/dager"
)

type neuralNet struct {
graph dager.Dager
// optimiser
// loss function
lock sync.RWMutex
}

type NeuralNet interface {
train() error
infer() error
}

// NewNeuralNet initialises a new neural network
func NewNeuralNet() NeuralNet {
return &neuralNet{}
}

func (nn *neuralNet) train() error {
fmt.Println("Training")
return nil
}

func (nn *neuralNet) infer() error {
fmt.Println("Infering")
return nil
}
3 changes: 3 additions & 0 deletions nn/nn_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package nn

import (
"fmt"
"testing"
)

func TestNNInit(t *testing.T) {
nn := NewNeuralNet()
fmt.Println(nn)
}

0 comments on commit 1bed91b

Please sign in to comment.