Skip to content

Instantly share code, notes, and snippets.

View justincosentino's full-sized avatar

Justin Cosentino justincosentino

View GitHub Profile
@justincosentino
justincosentino / input_features_estimator_demo.ipynb
Created October 21, 2020 00:39
input_features_estimator_demo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@justincosentino
justincosentino / selective_loss.py
Created March 10, 2020 19:27
Selective loss function from SelectiveNet
def selective_loss(
targets: torch.Tensor,
f_out: torch.Tensor,
g_out: torch.Tensor,
target_coverage: float,
lmbda: int = 32,
) -> torch.Tensor:
"""
Calculates the selective loss for the given slice.
@justincosentino
justincosentino / playground.ipynb
Last active November 6, 2019 10:22
playground
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@justincosentino
justincosentino / keybase.md
Last active September 4, 2017 04:57
keybase.md

Keybase proof

I hereby claim:

  • I am justincosentino on github.
  • I am cosentino (https://keybase.io/cosentino) on keybase.
  • I have a public key ASAN3Uk-_dcbfvYb4vhm4nx_meiDopoitsFkKsJlIQGC0wo

To claim this, I am signing this object:

def bootstrapDecipher(decipher, encoded_string, encoded_numeric, transition_matrix):
decoded_numeric = [decipher[s] for s in encoded_numeric]
decoded_string = numeric_to_text(decoded_numeric)
current_plausibility = plausibility(transition_matrix, decoded_string)
print ("Bootstrapping ", end="")
while current_plausibility == 0:
random.shuffle(decipher)
decoded_numeric = [decipher[s] for s in encoded_numeric]
decoded_string = numeric_to_text(decoded_numeric)
@justincosentino
justincosentino / gpaScraper.js
Last active August 29, 2015 14:14
MySwat GPA Scraper - Login to mySwarthmore, then: Student Main Menu -> Student Records -> Grades at a Glance and then run this in the console. I'm going to make it a bookmarklet later.
var gradeEquiv = {
'A+': 4,
'A' : 4,
'A-': 3.67,
'B+': 3.33,
'B' : 3,
'B-': 2.67,
'C+': 2.33,
'C' : 2,
'C-': 1.67,