Skip to content

Commit 4c01f51

Browse files
committed
Remove inactive
1 parent fc8f925 commit 4c01f51

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

tools/imatrix/imatrix.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ struct tensor_statistics {
5353
float min_values = 0.0f;
5454
int elements = 0;
5555
float stddev = 0.0f;
56-
float active = 0.0f;
5756
float entropy = 0.0f;
5857
float zd_score = 0.0f;
5958
float cossim = 0.0f;
@@ -169,11 +168,7 @@ static int compute_tensor_statistics(std::vector<tensor_statistics> & tstats, co
169168
const float sqr_sum = std::inner_product(activations.begin(), activations.end(), activations.begin(), 0.0f);
170169
const float variance = (sqr_sum / activations.size()) - (mean * mean);
171170
const float std_deviation = std::sqrt(std::max(0.0f, variance));
172-
const float threshold = 1e-5f * std_deviation;
173-
const int inactive_count = std::count_if(activations.begin(), activations.end(), [threshold](const float v) { return fabsf(v) <= threshold; });
174-
const float active_ratio = 1 - static_cast<float>(inactive_count) / activations.size();
175-
176-
float entropy = 0;
171+
float entropy = 0;
177172

178173
if (calc_mode == 1) {
179174
float div = 0.0;
@@ -218,7 +213,6 @@ static int compute_tensor_statistics(std::vector<tensor_statistics> & tstats, co
218213
ts.min_values = min;
219214
ts.elements = static_cast<int>(activations.size());
220215
ts.stddev = std_deviation;
221-
ts.active = active_ratio;
222216
ts.entropy = entropy;
223217
ts.zd_score = static_cast<float>(z_score) / ts.elements;
224218

0 commit comments

Comments
 (0)