Apply suggestions by @rcurtin.

This commit is contained in:
Yashwant
2020-06-14 10:17:44 +05:30
parent 33da5366e8
commit 136f176d1d
4 changed files with 16 additions and 14 deletions
+2
View File
@@ -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).
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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)
+12 -12
View File
@@ -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)