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 | |
os.environ["CUDA_VISIBLE_DEVICES"] = "2" | |
from torch.nn import functional as F | |
from torch import nn | |
import torch | |
from typing import Optional | |
from sentence_transformers import SentenceTransformer | |
from transformers.modeling_outputs import SequenceClassifierOutput | |
from datasets import Dataset |
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 gc | |
from copy import deepcopy | |
from dataclasses import dataclass | |
from typing import Tuple | |
import evaluate | |
import nltk | |
import torch | |
from datasets import Dataset, DatasetDict, load_dataset | |
from torch import FloatTensor, LongTensor |
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 gc | |
import re | |
from copy import deepcopy | |
from dataclasses import dataclass | |
import torch | |
from datasets import Dataset, DatasetDict, load_dataset | |
from math_verify import parse, verify | |
from peft import ( | |
LoraConfig, |
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
# coding=utf-8 | |
# Copyright 2021, The Facebook AI Research Team and The HuggingFace Inc. team. All rights reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
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 tensorflow as tf | |
import numpy as np | |
epochs = 10000 | |
batch_size = 1500 | |
d = 2 | |
enc_1_hidden_units = 128 | |
enc_2_hidden_units = 64 | |
mean_hidden_units = std_hidden_units = 2 | |
dec_1_hidden_units = 64 |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from random import random,choice | |
import networkx as nx | |
import matplotlib.pyplot as plt | |
import time | |
def watts(G,B): |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from random import randint,random | |
import networkx as nx | |
import matplotlib.pyplot as plt | |
import time | |
# http://stackoverflow.com/questions/479236/how-do-i-simulate-biased-die-in-python # | |
def roll(probs): |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import numpy as np | |
from sklearn.datasets import load_iris | |
class SOM: | |
def __init__(self,X,it,size_x,size_y,min_w=0,max_w=1,a=0.01): | |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# A5.py | |
# | |
# Author: overxfl0w13 | |
# | |
def header(): | |
print """ |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# DES.py | |
# | |
# Author: Overxfl0w13 | |
import binascii |
NewerOlder