Skip to content

Commit 3e9d53c

Browse files
committed
Refactor variable names
1 parent c7959ed commit 3e9d53c

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

tools/imatrix/imatrix.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ struct Stats {
4747
struct tensor_statistics {
4848
std::string tensor;
4949
Stats stats;
50-
float sum_values = 0.0f;
51-
float mean_values = 0.0f;
52-
float max_values = 0.0f;
53-
float min_values = 0.0f;
54-
int elements = 0;
55-
float stddev = 0.0f;
56-
float entropy = 0.0f;
57-
float zd_score = 0.0f;
58-
float cossim = 0.0f;
59-
float l2_norm = 0.0f;
50+
float sum_values = 0.0f;
51+
float mean_values = 0.0f;
52+
float max_values = 0.0f;
53+
float min_values = 0.0f;
54+
int elements = 0;
55+
float std_deviation = 0.0f;
56+
float entropy = 0.0f;
57+
float zd_score = 0.0f;
58+
float cossim = 0.0f;
59+
float l2_norm = 0.0f;
6060
};
6161

6262
class IMatrixCollector {
@@ -227,10 +227,10 @@ static bool compute_vector_statistics(std::vector<tensor_statistics> & tstats, c
227227
}
228228
}
229229

230-
int z_score = 0;
230+
int zd_score = 0;
231231
if (std_deviation > 0.0f) {
232232
for (const auto act : activations) {
233-
if (const float z = (act - mean) / std_deviation; std::fabs(z) > 1.0f) z_score++;
233+
if (const float z = (act - mean) / std_deviation; std::fabs(z) > 1.0f) zd_score++;
234234
}
235235
}
236236

@@ -242,9 +242,9 @@ static bool compute_vector_statistics(std::vector<tensor_statistics> & tstats, c
242242
ts.max_values = max;
243243
ts.min_values = min;
244244
ts.elements = static_cast<int>(activations.size());
245-
ts.stddev = std_deviation;
245+
ts.std_deviation = std_deviation;
246246
ts.entropy = entropy;
247-
ts.zd_score = static_cast<float>(z_score) / ts.elements;
247+
ts.zd_score = static_cast<float>(zd_score) / ts.elements;
248248

249249
return e.activations.empty();
250250
}
@@ -1334,7 +1334,7 @@ static bool show_statistics(const common_params & params) {
13341334
tstat.min_values,
13351335
tstat.max_values,
13361336
tstat.mean_values,
1337-
tstat.stddev,
1337+
tstat.std_deviation,
13381338
tstat.elements,
13391339
tstat.entropy,
13401340
100.0f * (tstat.entropy / std::log2(tstat.elements)),

0 commit comments

Comments
 (0)