Skip to content

Instantly share code, notes, and snippets.

@pvasu
pvasu / toy_example__model_raw_objective_vs_model_score.py
Last active January 15, 2025 23:57
Toy example to compare predicted distribution of scores when 'modeling raw objective then transforming to score' vs 'modeling score'
"""
See ClickUp task: https://app.clickup.com/t/86b32qrk6
Toy example to experiment with modeling a raw Approximate objective then transforming to
score vs modeling the score directly.
Process:
- define an Approximate objective with bounds [A, B] and target T
- fabricate several trials' measurements for this objective, as a uniform distribution
@pvasu
pvasu / default behavior - succeeds (altho warns about running as superuser)
Created November 20, 2024 19:57
Running optimizers-service locally with limited resources
▶ make skaffold-dev
skaffold dev -f k8s/skaffold.yaml --auto-build=false
Generating tags...
- us-docker.pkg.dev/notartifacts/compute-service/worker -> us-docker.pkg.dev/notartifacts/compute-service/worker:v0.7.4-83-g68f0ae5-dirty
Checking cache...
- us-docker.pkg.dev/notartifacts/compute-service/worker: Found Locally
Tags used in deployment:
- us-docker.pkg.dev/notartifacts/compute-service/worker -> us-docker.pkg.dev/notartifacts/compute-service/worker:be5b6889b86e164418c9eea0b6936fd491b3607387260cd8de8d458b763fda7c
Starting deploy...
@pvasu
pvasu / README
Created November 3, 2023 06:16
pydantic v2: in field_validator that validates field defined in parent model, ValidationInfo is empty
When validating a field that is defined in the parent model, we can't use ValidationInfo to access sibling fields
@pvasu
pvasu / tight inequality across multiple variables
Last active January 10, 2025 07:27
Reproduce Botorch bug where "tight inequalities" cause `get_polytope_samples` to not return diverse points
# NOTE this example calls the optimizers code, but can easily be translated to a pure Botorch example.
DOMAIN = {
"objectives": [
{
"bounds": [1.0, 2.0],
"name": "asdf",
"unit": "",
"weight": 1.0,
"category": "Analytical",
@pvasu
pvasu / clean.py
Created April 16, 2020 04:03
clean measurement data
from collections import defaultdict
import pandas as pd
import os as os
import re
dummy = pd.read_csv(str("/Users/pvasu/Downloads/dummy_example.csv")).set_index('Sample Name')
samplepat = re.compile('Sample(\d+)')
measurpat = re.compile('_(\d+)')
regionpat = re.compile('egion(\d+)')
@pvasu
pvasu / calendar.py
Created November 3, 2017 18:05
homework help
def print_month_calendar(num_of_days, starting_day):
#TODO
return None
def is_leap_year(year):
#TODO
return True
def print_year_calendar(year, starting_day):
#TODO
@pvasu
pvasu / index.html
Last active August 25, 2015 23:19
gennykrauseyoga index.html
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<!-- bxSlider Javascript file -->
<script src="./bxslider-4/dist/jquery.bxslider.min.js"></script>
<script src="./WallopSlider.js/dist/WallopSlider.js"></script>
<!-- bxSlider CSS file -->