Skip to content

Instantly share code, notes, and snippets.

View jacobdanovitch's full-sized avatar

Jacob Danovitch jacobdanovitch

View GitHub Profile
from typing import Optional, Tuple, Dict, Any, Union
from overrides import overrides
from copy import deepcopy
from allennlp.common import Registrable
from transformers.models.bert.configuration_bert import BertConfig
from transformers.models.bert.modeling_bert import BertLayer
from transformers.models.roberta.configuration_roberta import RobertaConfig
@jacobdanovitch
jacobdanovitch / config.json
Created October 2, 2020 14:45
AllenNLP Deepspeed Config
{
"dataset_reader": {
"type": "sst_tokens",
"granularity": "2-class",
"max_instances": 1000,
"token_indexers": {
"tokens": {
"type": "pretrained_transformer",
"model_name": "roberta-base"
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jacobdanovitch
jacobdanovitch / notemerge.sh
Created December 3, 2018 03:31
Brief script that merges all Md and IPynb files into one HTML file with a ToC. Assumes alphabetical sorting. Made for organizing school notes.
NAME="$1"
echo "Creating file $NAME.html"
FILES=*.md
for f in $FILES
do
filename="${f%.*}"
outfile="${filename}.ipynb"
echo "Converting $f to $outfile"
import numpy as np
from sklearn import linear_model
import pandas as pd
import requests
from sklearn.feature_extraction import DictVectorizer
team_id_list = ['1610612737','1610612738','1610612751','1610612766','1610612741','1610612739','1610612742','1610612743','1610612765','1610612744','1610612745','1610612754','1610612746','1610612747','1610612763','1610612748','1610612749','1610612750','1610612740','1610612752','1610612760','1610612753','1610612755','1610612756','1610612757','1610612758','1610612759','1610612761','1610612762','1610612764']
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36'}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import javafx.scene.control.*;
import javafx.scene.layout.Pane;
import javafx.scene.layout.BorderPane;
public class StickyNote extends BorderPane{
String noteStyle = "-fx-text-fill: black; -fx-background-color: white; -fx-border-color: black;";
String textFieldStyle = "-fx-text-overrun: ellipsis; -fx-background-color: transparent; -fx-border: gone;";
String text = "Your text here...";
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jacobdanovitch
jacobdanovitch / quiz2.py
Last active December 15, 2017 00:39
Quiz 2 Answers
'''
QUESTION 1
'''
def question1(number):
if number-int(number)==0:
return number
return number // 1 + 1
'''