Skip to content

Instantly share code, notes, and snippets.

View sgbaird's full-sized avatar

Sterling G. Baird sgbaird

View GitHub Profile
@sgbaird
sgbaird / History\-10222c04\entries.json
Last active June 21, 2022 04:00
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///c%3A/Users/sterg/Documents/GitHub/sparks-baird/bayes-opt-particle-packing/examples/paper_validation.py","entries":[{"id":"gqAt.py","timestamp":1651021972834},{"id":"J1l2.py","timestamp":1651022141759},{"id":"6PfT.py","timestamp":1651022226714},{"id":"vncu.py","timestamp":1651022242814},{"id":"95KM.py","timestamp":1651022353874},{"id":"xT1o.py","timestamp":1651022370345},{"id":"YpAY.py","timestamp":1651022424085},{"id":"VND3.py","timestamp":1651022453142},{"id":"uo2a.py","timestamp":1651022535298},{"id":"tyPf.py","source":"undoRedo.source","timestamp":1651022538140},{"id":"0bdL.py","timestamp":1651022558334},{"id":"2hpb.py","timestamp":1651022596152},{"id":"Hwyi.py","timestamp":1651022641384},{"id":"TjAr.py","timestamp":1651022741313},{"id":"GagW.py","timestamp":1651022767550},{"id":"dq1b.py","timestamp":1651022796139},{"id":"8Bb5.py","timestamp":1651022854709},{"id":"wHzw.py","timestamp":1651022883678},{"id":"7UtE.py","timestamp":1651022992369},{"id":"KjN9.py","timestamp":1651
@sgbaird
sgbaird / ordinal_example.py
Created December 8, 2021 23:23
Create some dummy data and generate ordinal encodings and parameters/constraints according to the Ax (adaptive design) framework.
"""Create some dummy data and generate ordinal encodings and parameters/constraints."""
import numpy as np
import pandas as pd
# %% data and choices
data = [["A", "B", "C"], ["D", "C", "A"], ["C", "A", "B"], ["C", "B", "A"]]
choices = list(np.unique(np.array(data).flatten()))
n_choices = len(choices)
# %% ordinal encoding
@sgbaird
sgbaird / gentle-intro-to-unit-tests.ipynb
Last active August 22, 2023 16:19
gentle-intro-to-unit-tests.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sgbaird
sgbaird / rst-to-myst.ipynb
Last active August 28, 2023 15:00
rst-to-myst.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{{! Numpy Docstring Template }}
{{summaryPlaceholder}}
{{extendedSummaryPlaceholder}}
{{#parametersExist}}
Parameters
----------
{{#args}}
{{var}} : {{typePlaceholder}}
@sgbaird
sgbaird / ax-pytest-plugin-debugger.ipynb
Created August 14, 2023 19:14
ax-pytest-plugin-debugger.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sgbaird
sgbaird / ax-service-api.ipynb
Last active April 29, 2024 14:29
ax-service-api.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sgbaird
sgbaird / count-lines-of-code.ipynb
Last active August 29, 2023 19:00
Count the number of lines of code using cloc and Google Colab (https://github.com/AlDanial/cloc). This is useful when you surpass the 500 MB limit of https://codetabs.com/count-loc/count-loc-online.html.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.