Skip to content

Commit

Permalink
Remove Gradient Descent (#3966)
Browse files Browse the repository at this point in the history
* Remove Gradient Descent

Signed-off-by: Chris Martin <[email protected]>

* Remove other code

Signed-off-by: Chris Martin <[email protected]>

* Remove test code

Signed-off-by: Chris Martin <[email protected]>

* go mod tidy

Signed-off-by: Chris Martin <[email protected]>

---------

Signed-off-by: Chris Martin <[email protected]>
  • Loading branch information
d80tb7 authored Sep 25, 2024
1 parent cfdeb0b commit c9d3661
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 350 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ require (
github.com/segmentio/fasthash v1.0.3
github.com/xitongsys/parquet-go v1.6.2
golang.org/x/time v0.5.0
gonum.org/v1/gonum v0.14.0
google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f
gopkg.in/inf.v0 v0.9.1
)
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -735,8 +735,6 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
gonum.org/v1/gonum v0.14.0 h1:2NiG67LD1tEH0D7kM+ps2V+fXmsAnpUeec7n8tcr4S0=
gonum.org/v1/gonum v0.14.0/go.mod h1:AoWeoz0becf9QMWtE8iWXNXc27fK4fNeHNf/oMejGfU=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
Expand Down
19 changes: 0 additions & 19 deletions internal/common/linalg/linalg.go

This file was deleted.

45 changes: 0 additions & 45 deletions internal/common/linalg/lingalg_test.go

This file was deleted.

44 changes: 0 additions & 44 deletions internal/common/optimisation/descent/descent.go

This file was deleted.

44 changes: 0 additions & 44 deletions internal/common/optimisation/descent/descent_test.go

This file was deleted.

60 changes: 0 additions & 60 deletions internal/common/optimisation/nesterov/nesterov.go

This file was deleted.

83 changes: 0 additions & 83 deletions internal/common/optimisation/nesterov/nesterov_test.go

This file was deleted.

11 changes: 0 additions & 11 deletions internal/common/optimisation/optimisation.go

This file was deleted.

29 changes: 3 additions & 26 deletions internal/common/slices/slices.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import (
"math/rand"

goslices "golang.org/x/exp/slices"

"github.com/armadaproject/armada/internal/common/interfaces"
)

// PartitionToMaxLen partitions the elements of s into non-overlapping slices,
Expand Down Expand Up @@ -205,31 +203,10 @@ func AnyFunc[S ~[]T, T any](s S, predicate func(val T) bool) bool {

// AllFunc returns true if predicate(v) returns true for all values v in s.
func AllFunc[S ~[]T, T any](s S, predicate func(val T) bool) bool {
result := true
for _, v := range s {
result = predicate(v) && result
if !result {
return result
if !predicate(v) {
return false
}
}
return result
}

// Zeros returns a slice T[] of length n with all elements equal to zero.
func Zeros[T any](n int) []T {
return make([]T, n)
}

// Fill returns a slice T[] of length n with all elements equal to v.
func Fill[T any](v T, n int) []T {
rv := make([]T, n)
for i := range rv {
rv[i] = v
}
return rv
}

// Ones returns a slice T[] of length n with all elements equal to 1.
func Ones[T interfaces.Number](n int) []T {
return Fill[T](1, n)
return true
}
15 changes: 0 additions & 15 deletions internal/common/slices/slices_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,18 +450,3 @@ func TestAny(t *testing.T) {
AnyFunc([]int{1, 2, 3}, func(v int) bool { return v > 3 }),
)
}

func TestZeros(t *testing.T) {
assert.Equal(t, make([]int, 3), Zeros[int](3))
assert.Equal(t, make([]string, 3), Zeros[string](3))
}

func TestOnes(t *testing.T) {
assert.Equal(t, []int{1, 1, 1}, Ones[int](3))
assert.Equal(t, []float64{1, 1, 1}, Ones[float64](3))
}

func TestFill(t *testing.T) {
assert.Equal(t, []int{2, 2, 2}, Fill[int](2, 3))
assert.Equal(t, []float64{0.5, 0.5, 0.5}, Fill[float64](0.5, 3))
}

0 comments on commit c9d3661

Please sign in to comment.