Spaces:
Running
Running
added check_for_power_of_two(x) func
Browse files- tab_manager.py +11 -0
tab_manager.py
CHANGED
@@ -194,6 +194,17 @@ def create_word_distribution_csv(data, evalID, evalType):
|
|
194 |
for obj, val, norm, ii in zip(listOfObjects, data[0].values(), data[1], range(len(listOfObjects))):
|
195 |
csvContents.append([ii, obj[0], val, norm])
|
196 |
return pd.DataFrame(csvContents).to_csv(header=False,index=False).encode('utf-8')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
def initiate_general_bias_evaluation(tab, modelID, specs, imagesTab):
|
198 |
startTime = time.time()
|
199 |
objectData = None
|
|
|
194 |
for obj, val, norm, ii in zip(listOfObjects, data[0].values(), data[1], range(len(listOfObjects))):
|
195 |
csvContents.append([ii, obj[0], val, norm])
|
196 |
return pd.DataFrame(csvContents).to_csv(header=False,index=False).encode('utf-8')
|
197 |
+
|
198 |
+
def check_for_power_of_two(x):
|
199 |
+
if (x == 0):
|
200 |
+
return False
|
201 |
+
while (x != 1):
|
202 |
+
if (x % 2 != 0):
|
203 |
+
return False
|
204 |
+
x = x // 2
|
205 |
+
|
206 |
+
return True
|
207 |
+
|
208 |
def initiate_general_bias_evaluation(tab, modelID, specs, imagesTab):
|
209 |
startTime = time.time()
|
210 |
objectData = None
|