Spaces:
Sleeping
Sleeping
Update classifier.py
Browse files- classifier.py +1 -1
classifier.py
CHANGED
|
@@ -109,7 +109,7 @@ class Classifier:
|
|
| 109 |
# To simplify the query, we separated
|
| 110 |
# the calculation into class numbers
|
| 111 |
grad_q_str = f"""
|
| 112 |
-
SELECT
|
| 113 |
FROM (
|
| 114 |
SELECT groupArray(arrayPopBack(prelogit)) AS X,
|
| 115 |
groupArray(1/(1+exp(-arraySum(arrayMap((x,y)->x*y, prelogit, {xq_s[n]}))))) AS Y, {labels} AS GT
|
|
|
|
| 109 |
# To simplify the query, we separated
|
| 110 |
# the calculation into class numbers
|
| 111 |
grad_q_str = f"""
|
| 112 |
+
SELECT avgForEachArray(arrayMap((x,y,gt)->arrayMap(i->i*(y-gt), x), X, Y, GT)) AS grad
|
| 113 |
FROM (
|
| 114 |
SELECT groupArray(arrayPopBack(prelogit)) AS X,
|
| 115 |
groupArray(1/(1+exp(-arraySum(arrayMap((x,y)->x*y, prelogit, {xq_s[n]}))))) AS Y, {labels} AS GT
|