-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ran basic experiment with convergence filter
- Loading branch information
Nathaniel Imel
authored and
Nathaniel Imel
committed
Nov 11, 2023
1 parent
f68981b
commit 04b2f41
Showing
4 changed files
with
6,662 additions
and
37 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import numpy as np | ||
import pandas as pd | ||
import plotnine as pn | ||
import matplotlib.pyplot as plt | ||
|
||
from sciterra.mapping.atlas import Atlas | ||
from sciterra.mapping.cartography import Cartographer | ||
from sciterra.vectorization.scibert import SciBERTVectorizer | ||
|
||
atlas_dir = "/Users/nathanielimel/uci/projects/sciterra/src/examples/scratch/outputs/atlas_s2-11-10-23_centered_hafenetal" | ||
|
||
def main(): | ||
|
||
atl = Atlas.load(atlas_dir) | ||
|
||
kernels = atl.history['kernel_size'] | ||
|
||
con_d = 3 | ||
kernel_size = 10 | ||
converged_filter = kernels[:, -con_d] >= kernel_size | ||
ids = np.array(atl.projection.index_to_identifier) | ||
converged_pub_ids = ids[converged_filter] | ||
|
||
crt = Cartographer(vectorizer=SciBERTVectorizer()) | ||
|
||
measurements = crt.measure_topography( | ||
atl, | ||
ids=converged_pub_ids, | ||
metrics=["density", "edginess"], | ||
kernel_size=10, | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.