Update the metric module
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 32/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- numpy, python
- Domain
- machine-learning
Research direction
Start by reading metric.py and checking how its current metric class is used elsewhere. Compare the proposed stateless function approach with the Keras metrics reference, then verify the intended accuracy inputs and result. Done means the metric module uses functions as requested without breaking its existing callers.
Written by the indexing model from the issue text.
Description
It would be better to implement a metric as a function in the metric.py as metric typically has not states. Therefore, no need to make it as a class. e.g,
def accuracy(y_pred, y_true):
"""compute the accuracy.
Args:
y_pred(numpy array or tensor): each value is a label index
y_true(numpy array or tensor): each value is a label index
"""
check shape match
convert y_pred and y_true to np array
return np.sum(y_pred== y_true) / y_true.shape[0]
Refer to https://keras.io/api/metrics/
- Dominant language
- C++
- Stars
- 3.6k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/singa
-
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 15/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
google/libultrahdr#485 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
godotengine/godot#123776 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 60/100
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
ros2/common_interfaces#344 ·