mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-02 18:07:43 +00:00
Build model class inheritance (#44)
* update all code * fix a typo --------- Co-authored-by: xuyang1 <xuyang1@microsoft.com>
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
# TODO: inherent from the benchmark base class
|
||||
import torch
|
||||
from rdagent.components.task_implementation.model_implementation.task import ModelTaskImpl
|
||||
|
||||
from rdagent.components.task_implementation.model_implementation.model import (
|
||||
ModelImplementation,
|
||||
)
|
||||
|
||||
|
||||
def get_data_conf(init_val):
|
||||
@@ -15,7 +18,7 @@ def get_data_conf(init_val):
|
||||
|
||||
class ModelImpValEval:
|
||||
"""
|
||||
Evaluate the similarity of the model structure by changing the input and observate the output.
|
||||
Evaluate the similarity of the model structure by changing the input and observe the output.
|
||||
|
||||
Assumption:
|
||||
- If the model structure is similar, the output will change in similar way when we change the input.
|
||||
@@ -31,7 +34,7 @@ class ModelImpValEval:
|
||||
For each hidden output, we can calculate a correlation. The average correlation will be the metrics.
|
||||
"""
|
||||
|
||||
def evaluate(self, gt: ModelTaskImpl, gen: ModelTaskImpl):
|
||||
def evaluate(self, gt: ModelImplementation, gen: ModelImplementation):
|
||||
round_n = 10
|
||||
|
||||
eval_pairs: list[tuple] = []
|
||||
|
||||
Reference in New Issue
Block a user