Charles Kabui
commited on
Commit
·
88e7d50
1
Parent(s):
caaff56
cosine_similarity_scores_2
Browse files- .gitignore +2 -1
- data/preview.ipynb +2 -32
- utils/get_unique_values.py +13 -0
.gitignore
CHANGED
@@ -3,4 +3,5 @@ __pycache__
|
|
3 |
*.pickle
|
4 |
*.zip
|
5 |
*.json
|
6 |
-
.DS_Store
|
|
|
|
3 |
*.pickle
|
4 |
*.zip
|
5 |
*.json
|
6 |
+
.DS_Store
|
7 |
+
*.png
|
data/preview.ipynb
CHANGED
@@ -219,37 +219,7 @@
|
|
219 |
"\n",
|
220 |
"def format_name(file_name: str):\n",
|
221 |
" name_, ext_ = file_name.split('.')\n",
|
222 |
-
" return f'PNG/{name_[:4]}---{name_[-4:]}.{ext_}'
|
223 |
-
]
|
224 |
-
},
|
225 |
-
{
|
226 |
-
"cell_type": "code",
|
227 |
-
"execution_count": 73,
|
228 |
-
"metadata": {
|
229 |
-
"colab": {
|
230 |
-
"base_uri": "https://localhost:8080/",
|
231 |
-
"height": 35
|
232 |
-
},
|
233 |
-
"id": "P-LCWf2LOaOM",
|
234 |
-
"outputId": "6a35e807-a114-4cc9-af63-d216ea0bac13"
|
235 |
-
},
|
236 |
-
"outputs": [
|
237 |
-
{
|
238 |
-
"data": {
|
239 |
-
"application/vnd.google.colaboratory.intrinsic+json": {
|
240 |
-
"type": "string"
|
241 |
-
},
|
242 |
-
"text/plain": [
|
243 |
-
"'PNG/6aa1---d46b.png'"
|
244 |
-
]
|
245 |
-
},
|
246 |
-
"execution_count": 73,
|
247 |
-
"metadata": {},
|
248 |
-
"output_type": "execute_result"
|
249 |
-
}
|
250 |
-
],
|
251 |
-
"source": [
|
252 |
-
"format_name(images[0].split('/')[-1])"
|
253 |
]
|
254 |
},
|
255 |
{
|
@@ -413,7 +383,7 @@
|
|
413 |
"name": "python",
|
414 |
"nbconvert_exporter": "python",
|
415 |
"pygments_lexer": "ipython3",
|
416 |
-
"version": "3.
|
417 |
}
|
418 |
},
|
419 |
"nbformat": 4,
|
|
|
219 |
"\n",
|
220 |
"def format_name(file_name: str):\n",
|
221 |
" name_, ext_ = file_name.split('.')\n",
|
222 |
+
" return f'PNG/{name_[:4]}---{name_[-4:]}.{ext_}'"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
]
|
224 |
},
|
225 |
{
|
|
|
383 |
"name": "python",
|
384 |
"nbconvert_exporter": "python",
|
385 |
"pygments_lexer": "ipython3",
|
386 |
+
"version": "3.1.0"
|
387 |
}
|
388 |
},
|
389 |
"nbformat": 4,
|
utils/get_unique_values.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import numpy as np
|
2 |
+
|
3 |
+
def get_unique_values(start, end, count):
|
4 |
+
'''
|
5 |
+
Returns a list of unique countinous values between start and end
|
6 |
+
Args:
|
7 |
+
start: int - less than end
|
8 |
+
end: int - greater than start
|
9 |
+
count: int - number of values to return
|
10 |
+
Returns:
|
11 |
+
List[int]
|
12 |
+
'''
|
13 |
+
return np.arange(start, end, (end - start)/count)[:count]
|