Apply suggestions by @rcurtin.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
### mlpack ?.?.?
|
||||
###### ????-??-??
|
||||
* Add Go bindings (#1884).
|
||||
|
||||
* Added Dueling DQN to q_networks, Noisy linear layer to ann/layer
|
||||
and Empty loss to ann/loss_functions (#2414).
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ Installing the mlpack bindings for Go is somewhat time-consuming as the library
|
||||
must be built; you can run the following code:
|
||||
|
||||
@code{.sh}
|
||||
go get -d mlpack.org/v1/mlpack
|
||||
go get -u -d mlpack.org/v1/mlpack
|
||||
cd ${GOPATH}/src/mlpack.org/v1/mlpack
|
||||
make install
|
||||
@endcode
|
||||
|
||||
@@ -22,7 +22,7 @@ if (BUILD_GO_BINDINGS)
|
||||
find_package(Gonum)
|
||||
if (NOT GO_FOUND OR NOT GONUM_FOUND)
|
||||
unset(BUILD_GO_BINDINGS CACHE)
|
||||
message(FATAL_ERROR "Could not Build Go Bindings")
|
||||
message(FATAL_ERROR "Go or Gonum not found; unable to build Go bindings!")
|
||||
endif()
|
||||
else ()
|
||||
find_package(Go 1.11.0)
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
package mlpack
|
||||
|
||||
import (
|
||||
"encoding/csv"
|
||||
"io"
|
||||
"os"
|
||||
"strconv"
|
||||
"net/http"
|
||||
"compress/gzip"
|
||||
|
||||
"gonum.org/v1/gonum/mat"
|
||||
"encoding/csv"
|
||||
"io"
|
||||
"os"
|
||||
"strconv"
|
||||
"net/http"
|
||||
"compress/gzip"
|
||||
"gonum.org/v1/gonum/mat"
|
||||
)
|
||||
|
||||
// Load reads all of the numeric records from the CSV.
|
||||
// Load() reads all of the numeric records from the CSV.
|
||||
func Load(filename string) (*mat.Dense, error) {
|
||||
var elements int
|
||||
var rows int
|
||||
@@ -49,7 +48,7 @@ func Load(filename string) (*mat.Dense, error) {
|
||||
return output, nil
|
||||
}
|
||||
|
||||
// Save writes all of the records to the CSV.
|
||||
// Save() writes all of the records to the CSV.
|
||||
func Save(filename string, mat *mat.Dense) error {
|
||||
// Create the file
|
||||
file, err := os.Create(filename)
|
||||
@@ -78,7 +77,7 @@ func Save(filename string, mat *mat.Dense) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Unizp unzips the given input to the given the output file.
|
||||
// UnZip() unzips the given input to the given the output file.
|
||||
func UnZip(input string, output string) error {
|
||||
// Create the file
|
||||
out, err := os.Create(output)
|
||||
@@ -109,7 +108,8 @@ func UnZip(input string, output string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// DownloadFile downloads the file from the given url and save it to the given filename.
|
||||
// DownloadFile() downloads the file from the given url and
|
||||
// save it to the given filename.
|
||||
func DownloadFile (url string, filename string) error {
|
||||
// Create the file
|
||||
out, err := os.Create(filename)
|
||||
|
||||
Reference in New Issue
Block a user