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 numpy as np | |
from collections import defaultdict | |
from typing import List, Tuple | |
def cosine_similarity(v1: np.ndarray, v2: np.ndarray) -> float: | |
dot_product = np.dot(v1, v2) | |
norm_v1 = np.linalg.norm(v1) | |
norm_v2 = np.linalg.norm(v2) | |
return dot_product / (norm_v1 * norm_v2) |
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 { makeStyles, Theme, createStyles } from '@material-ui/core/styles'; | |
import { themeColors } from 'styles/global-styles'; | |
export const useStyles = makeStyles((theme: Theme) => | |
createStyles({ | |
main: { | |
// height: '84vh', | |
textAlign: 'left' | |
}, | |
comment: { |
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
use anchor_lang::prelude::*; | |
declare_id!("5gaQPYyZV2EzyMEG6z2a1B5ZpdXxGmru7eEV5pNZJeNv"); | |
#[program] | |
pub mod mycalculator { | |
use anchor_lang::solana_program::entrypoint::ProgramResult; | |
use super::*; |
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
use anchor_lang::prelude::*; | |
declare_id!("5gaQPYyZV2EzyMEG6z2a1B5ZpdXxGmru7eEV5pNZJeNv"); | |
#[program] | |
pub mod mycalculator { | |
use anchor_lang::solana_program::entrypoint::ProgramResult; | |
use super::*; |
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
use anchor_lang::prelude::*; | |
declare_id!("5gaQPYyZV2EzyMEG6z2a1B5ZpdXxGmru7eEV5pNZJeNv"); | |
#[program] | |
pub mod mycalculator { | |
use anchor_lang::solana_program::entrypoint::ProgramResult; | |
use super::*; |
OlderNewer