-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from pedromxavier/px/benchmark
Add benchmarks
- Loading branch information
Showing
13 changed files
with
182 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "WiSARD" | ||
uuid = "2b71b7a6-5a26-4a05-9b8d-679d5aa759d4" | ||
authors = ["pedromxavier <[email protected]>"] | ||
version = "0.2.0" | ||
version = "0.3.0" | ||
|
||
[deps] | ||
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Benchmark results | ||
results.json | ||
|
||
# Benchmark Tunings | ||
tune.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[deps] | ||
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" | ||
MLDatasets = "eb30cadb-4394-5ae3-aed4-317e484a6458" | ||
PkgBenchmark = "32113eaa-f34f-5b0d-bd6c-c81e245fc73d" | ||
WiSARD = "2b71b7a6-5a26-4a05-9b8d-679d5aa759d4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using BenchmarkTools | ||
using WiSARD | ||
using MLDatasets | ||
|
||
const SUITE = BenchmarkGroup() | ||
|
||
# -*- MNIST -*- # | ||
include("suites/mnist.jl") | ||
|
||
mnist_benchmark!(SUITE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import Pkg | ||
Pkg.add(path=joinpath(@__DIR__, "..")) | ||
Pkg.instantiate() | ||
|
||
using WiSARD | ||
using PkgBenchmark | ||
|
||
const RESULTS_PATH = joinpath(@__DIR__, "results") | ||
const RESULTS_FILE = joinpath(RESULTS_PATH, "results.json") | ||
|
||
function main() | ||
results = benchmarkpkg(WiSARD) | ||
|
||
writeresults(RESULTS_FILE, results) | ||
|
||
return nothing | ||
end | ||
|
||
main() # Here we go! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
function mnist_benchmark!(SUITE::BenchmarkGroup) | ||
mnist_wnn = () -> WiSARD.WNN{Int,UInt}(28, 28) | ||
|
||
SUITE["mnist"] = BenchmarkGroup(["MNIST"]) | ||
|
||
mnist_trainset = MLDatasets.MNIST(Int, :train) | ||
mnist_train_x = [mnist_trainset[i][:features] for i = 1:60_000] | ||
mnist_train_y = [mnist_trainset[i][:targets] for i = 1:60_000] | ||
|
||
SUITE["mnist"]["train"] = @benchmarkable WiSARD.train!.( | ||
$mnist_wnn(), | ||
$mnist_train_x, | ||
$mnist_train_y, | ||
) | ||
|
||
mnist_testset = MLDatasets.MNIST(Int, :test) | ||
mnist_test_x = [mnist_testset[i][:features] for i = 1:10_000] | ||
# mnist_test_y = [mnist_testset[i][:targets] for i = 1:10_000] | ||
|
||
SUITE["mnist"]["test"] = @benchmarkable WiSARD.classify.( | ||
$mnist_wnn(), | ||
$mnist_test_x, | ||
) | ||
|
||
return nothing | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@doc raw""" | ||
""" function train! end | ||
|
||
@doc raw""" | ||
""" function classhint! end | ||
|
||
@doc raw""" | ||
""" function classify end | ||
|
||
@doc raw""" | ||
""" function address end | ||
|
||
@doc raw""" | ||
""" function images end | ||
|
||
@doc raw""" | ||
""" function deaddress end |
Oops, something went wrong.
8ae7c14
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
8ae7c14
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/71044
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: