This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from sqlalchemy import create_engine | |
from sqlalchemy.types import VARCHAR | |
from pandas.io.sql import SQLTable, pandasSQL_builder | |
import tempfile | |
import numpy as np | |
import boto3 | |
import json | |
import pandas as pd | |
from sqlalchemy import text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def re_ranking(model, probFea,galFea,k1,k2,lambda_value): | |
query_num = probFea.shape[0] | |
all_num = query_num + galFea.shape[0] | |
feat = np.append(probFea,galFea,axis = 0) | |
feat = feat.astype(np.float16) | |
feat = torch.from_numpy(feat).half().cuda() | |
print('computing original distance') | |
sz = feat.shape[0] | |
d = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def qwk(a1, a2): | |
""" | |
Source: https://www.kaggle.com/c/data-science-bowl-2019/discussion/114133#latest-660168 | |
:param a1: | |
:param a2: | |
:param max_rat: | |
:return: | |
""" | |
max_rat = 3 |
OlderNewer