music_detector 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3401a5f37951bc70e14a7f2c09f8b1166cefd8c7
|
4
|
+
data.tar.gz: f129f4889bd70baed3d2a2982e4055e5de9a39d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4cf93ae96552f60927f148fa187771b02b2cbff0717b66bbc94d58a69d84ce3aee0d23f1917e907bfd576a0721559641450103ebc491b3c534b867d4c2cc5c60
|
7
|
+
data.tar.gz: 20cff17b463ee4da7831614877394716447e4a71af0ed7104b80b12c4b33dc4653077f7bb27c04875539d80881a2535492e4567950d3256f0686084bcc56ab9d
|
@@ -63,6 +63,7 @@ module MusicDetector
|
|
63
63
|
end
|
64
64
|
|
65
65
|
# @param [NArray] fvs array of input feature vector(s)
|
66
|
+
# @return [Array<Boolean>] estimated result; if the n-th element is true, the n-th feature vector might contain music
|
66
67
|
def estimate(fvs)
|
67
68
|
raise ArgumentError('the form of the input is differ from trained model') if @b.total - 1 != fvs.shape[0]
|
68
69
|
|
@@ -78,7 +79,10 @@ module MusicDetector
|
|
78
79
|
x[1..(fvs.shape[0]), i] = fvs[true, i].flatten
|
79
80
|
end
|
80
81
|
end
|
81
|
-
x * @b
|
82
|
+
y = x * @b
|
83
|
+
y[y < 0] = false
|
84
|
+
y[y >= 0] = true
|
85
|
+
y.to_a
|
82
86
|
end
|
83
87
|
|
84
88
|
def export_to(file_path, config:)
|