repo stringlengths 1 99 | file stringlengths 13 215 | code stringlengths 12 59.2M | file_length int64 12 59.2M | avg_line_length float64 3.82 1.48M | max_line_length int64 12 2.51M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
benchmarking_graph | benchmarking_graph-main/src/models.py | from functools import partial
import jax
import jax.numpy as jnp
from jax import lax, random, vmap
from .io import loadfile, savefile
def initialize_mlp(sizes, key, affine=[False], scale=1.0):
""" Initialize the weights of all layers of a linear layer network """
keys = random.split(key, len(sizes))
# I... | 3,474 | 27.483607 | 120 | py |
benchmarking_graph | benchmarking_graph-main/src/io.py | """
"""
import pickle
import jax.numpy as jnp
def loadfile(filename, verbose=False):
if verbose:
print(f"Loading {filename}")
return pickle.load(open(filename, "rb"))
def savefile(filename, data, metadata={}, verbose=False):
if verbose:
print(f"Saving {filename}")
pickle.dump((data,... | 1,685 | 31.423077 | 92 | py |
benchmarking_graph | benchmarking_graph-main/src/lnn1.py | from functools import partial
import jax
import jax.numpy as jnp
import numpy as np
from jax import grad, jit, vmap
from numpy.core.fromnumeric import reshape
from .models import ReLU, SquarePlus, forward_pass
def MAP(input_fn):
"""Map vmap for first input.
:param input_fn: function to map
:type input_... | 12,736 | 26.68913 | 149 | py |
benchmarking_graph | benchmarking_graph-main/src/fgn.py | from functools import partial
import haiku as hk
import jax
import jax.numpy as jnp
import numpy as np
from jax import grad, jit, lax, random
from jax_md.nn import GraphNetEncoder
from jraph import GraphMapFeatures, GraphNetwork, GraphsTuple
from src.models import SquarePlus, forward_pass, initialize_mlp
class Grap... | 5,146 | 31.371069 | 99 | py |
benchmarking_graph | benchmarking_graph-main/scripts/peridynamics-HGN-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as jnp
import... | 12,889 | 27.836689 | 152 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-CFGNODE.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 16,284 | 30.560078 | 165 | py |
benchmarking_graph | benchmarking_graph-main/scripts/n-body-LGNN-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 19,807 | 32.802048 | 247 | py |
benchmarking_graph | benchmarking_graph-main/scripts/n-body-data.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
import fire
import jax
import jax.numpy as jnp
import numpy as np
from ... | 6,696 | 28.244541 | 100 | py |
benchmarking_graph | benchmarking_graph-main/scripts/peridynamics-HGNN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import time
import fire
import jax
import jax.numpy a... | 13,231 | 26.798319 | 152 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Spring-data-FGNN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
import fire
import jax
import jax.numpy as jnp
import numpy as np
from ... | 7,185 | 29.320675 | 105 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Spring-FGNODE-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 20,256 | 32.538079 | 247 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Spring-GNODE.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as jnp
import... | 13,629 | 26.816327 | 134 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Spring-HGNN.py | ################################################
################## IMPORT ######################
################################################
from posixpath import split
import sys
import os
from datetime import datetime
from functools import partial, wraps
import fire
import jax
import jax.numpy as jnp
import m... | 12,742 | 26.823144 | 255 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-data-FGNN.py | ################################################
################## IMPORT ######################
################################################
import json
from pyexpat import model
from statistics import mode
import sys
import os
from datetime import datetime
from functools import partial, wraps
import jax
import... | 6,168 | 28.516746 | 97 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-HGNN-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 18,563 | 32.814208 | 354 | py |
benchmarking_graph | benchmarking_graph-main/scripts/peridynamics-HGNN-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as jnp
import... | 12,346 | 27.983568 | 152 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Spring-FGNN-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 19,912 | 32.023217 | 225 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-HGN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
import fire
import jax
import jax.numpy as jnp
import numpy as np
from jax import... | 14,684 | 29.030675 | 184 | py |
benchmarking_graph | benchmarking_graph-main/scripts/peridynamics-FGNN-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as jnp
import... | 10,978 | 27.740838 | 152 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Spring-LGN-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 18,363 | 31.676157 | 247 | py |
benchmarking_graph | benchmarking_graph-main/scripts/peridynamics-HGN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import time
import fire
import jax
import jax.numpy a... | 14,681 | 27.019084 | 152 | py |
benchmarking_graph | benchmarking_graph-main/scripts/peridynamics-LGNN-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as jnp
import... | 11,922 | 27.93932 | 152 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-HGN-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 20,724 | 32.481422 | 248 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-GNODE-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 19,024 | 33.403255 | 355 | py |
benchmarking_graph | benchmarking_graph-main/scripts/peridynamics-FGNODE.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import time
import fire
import jax
import jax.numpy a... | 13,050 | 27.066667 | 152 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Spring-data.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
import fire
import jax
import jax.numpy as jnp
import numpy as np
from ... | 6,624 | 28.444444 | 97 | py |
benchmarking_graph | benchmarking_graph-main/scripts/n-body-LGN-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 19,621 | 31.922819 | 247 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-CHGN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
import fire
import jax
import jax.numpy as jnp
import numpy as np
from jax import... | 14,712 | 28.843813 | 184 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-CHGNN-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 17,699 | 32.333333 | 203 | py |
benchmarking_graph | benchmarking_graph-main/scripts/n-body-FGNN-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 20,094 | 32.603679 | 224 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-LGN-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 18,959 | 32.321617 | 196 | py |
benchmarking_graph | benchmarking_graph-main/scripts/peridynamics-GNODE.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import time
import fire
import jax
import jax.numpy a... | 13,557 | 27.364017 | 152 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-LGNN-post.py | ################################################
################## IMPORT ######################
################################################
# from fcntl import F_SEAL_SEAL
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire... | 18,884 | 31.786458 | 356 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Spring-data-HGNN.py | ################################################
################## IMPORT ######################
################################################
import sys
import fire
import os
from datetime import datetime
from functools import partial, wraps
from psystems.nsprings import chain
import jax
import jax.numpy as jnp
... | 6,035 | 27.880383 | 99 | py |
benchmarking_graph | benchmarking_graph-main/scripts/peridynamics-LGN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import time
import fire
import jax
import jax.numpy a... | 14,755 | 27.376923 | 152 | py |
benchmarking_graph | benchmarking_graph-main/scripts/n-body-data-HGNN.py | ################################################
################## IMPORT ######################
################################################
import sys
import fire
import os
from datetime import datetime
from functools import partial, wraps
from psystems.nsprings import chain
import jax
import jax.numpy as jnp
... | 6,086 | 28.838235 | 107 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-CLGN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 15,534 | 30.194779 | 142 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Spring-FGNN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
import fire
import jax
import jax.numpy as jnp
import numpy as np
from jax import... | 17,514 | 30.054965 | 162 | py |
benchmarking_graph | benchmarking_graph-main/scripts/n-body-GNODE.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as jnp
import... | 13,643 | 26.788187 | 134 | py |
benchmarking_graph | benchmarking_graph-main/scripts/peridynamics-FGNN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import time
import fire
import jax
import jax.numpy a... | 13,407 | 27.050209 | 152 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Spring-LGNN-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 19,812 | 32.524535 | 247 | py |
benchmarking_graph | benchmarking_graph-main/scripts/n-body-FGNN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
import fire
import jax
import jax.numpy as jnp
import numpy as np
from jax import... | 17,475 | 30.488288 | 162 | py |
benchmarking_graph | benchmarking_graph-main/scripts/n-body-GNODE-post.py | ################################################
################## IMPORT ######################
################################################
import imp
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import ja... | 21,131 | 34.22 | 247 | py |
benchmarking_graph | benchmarking_graph-main/scripts/n-body-LGNN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 14,226 | 29.530043 | 204 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Spring-HGN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
import fire
import jax
import jax.numpy as jnp
import numpy as np
from jax import... | 15,726 | 29.361004 | 184 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Spring-FGNODE.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
import fire
import jax
import jax.numpy as jnp
import numpy as np
from jax import... | 16,226 | 29.84981 | 184 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-CLGNN-post.py | ################################################
################## IMPORT ######################
################################################
# from fcntl import F_SEAL_SEAL
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire... | 17,750 | 31.392336 | 205 | py |
benchmarking_graph | benchmarking_graph-main/scripts/n-body-FGNODE-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 20,013 | 32.580537 | 246 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-HGNN.py | ################################################
################## IMPORT ######################
################################################
from posixpath import split
import sys
import os
from datetime import datetime
from functools import partial, wraps
import fire
import jax
import jax.numpy as jnp
import m... | 15,437 | 30.962733 | 353 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-GNODE.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 16,262 | 29.060998 | 121 | py |
benchmarking_graph | benchmarking_graph-main/scripts/n-body-HGNN-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 19,693 | 33.795053 | 245 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Spring-HGNN-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 19,637 | 33.452632 | 245 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-FGNN-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 19,478 | 32.354452 | 370 | py |
benchmarking_graph | benchmarking_graph-main/scripts/n-body-HGN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
import fire
import jax
import jax.numpy as jnp
import numpy as np
from jax import... | 15,645 | 29.982178 | 184 | py |
benchmarking_graph | benchmarking_graph-main/scripts/n-body-LGN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
import fire
import jax
import jax.numpy as jnp
import numpy as np
from jax import... | 16,521 | 30.530534 | 162 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-LGNN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 16,955 | 32.117188 | 316 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-CLGN-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 19,008 | 32.116725 | 196 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-FGNODE-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 18,532 | 32.27289 | 219 | py |
benchmarking_graph | benchmarking_graph-main/scripts/n-body-FGNODE.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
import fire
import jax
import jax.numpy as jnp
import numpy as np
from jax import... | 16,177 | 30.413592 | 184 | py |
benchmarking_graph | benchmarking_graph-main/scripts/peridynamics-LGNN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import time
import fire
import jax
import jax.numpy a... | 13,916 | 27.344196 | 152 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-LGN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 15,541 | 30.146293 | 142 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-FGNN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
from turtle import hideturtle
import fire
i... | 20,161 | 32.942761 | 286 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Spring-HGN-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as jnp
import... | 21,151 | 32.8432 | 247 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-CGNODE.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as jnp
import... | 14,134 | 26.661448 | 114 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-CHGN-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as jnp
import... | 20,725 | 32.537217 | 248 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-data.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
import jax
import jax.numpy as jnp
import numpy as np
from jax import j... | 5,891 | 28.024631 | 97 | py |
benchmarking_graph | benchmarking_graph-main/scripts/peridynamics-GNODE-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as jnp
import... | 11,310 | 27.854592 | 152 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Spring-LGNN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 14,856 | 29.382413 | 173 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-FGNODE.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 16,215 | 30.610136 | 216 | py |
benchmarking_graph | benchmarking_graph-main/scripts/n-body-HGNN.py | ################################################
################## IMPORT ######################
################################################
from posixpath import split
import sys
import os
from datetime import datetime
from functools import partial, wraps
import fire
import jax
import jax.numpy as jnp
import m... | 12,752 | 28.727273 | 255 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-data-HGNN.py | ################################################
################## IMPORT ######################
################################################
import sys
import fire
import os
from datetime import datetime
from functools import partial, wraps
from psystems.npendulum import get_init
import jax
import jax.numpy as ... | 5,374 | 27.141361 | 101 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-CHGNN.py | ################################################
################## IMPORT ######################
################################################
from posixpath import split
import sys
import os
from datetime import datetime
from functools import partial, wraps
import fire
import jax
import jax.numpy as jnp
import m... | 12,543 | 26.569231 | 164 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-CLGNN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as ... | 13,992 | 29.092473 | 137 | py |
benchmarking_graph | benchmarking_graph-main/scripts/peridynamics-FGNODE-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as jnp
import... | 10,997 | 27.866142 | 152 | py |
benchmarking_graph | benchmarking_graph-main/scripts/n-body-data-FGNN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
import fire
import jax
import jax.numpy as jnp
import numpy as np
from ... | 7,313 | 29.60251 | 107 | py |
benchmarking_graph | benchmarking_graph-main/scripts/n-body-HGN-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as jnp
import... | 21,326 | 33.1232 | 247 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-CGNODE-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as jnp
import... | 18,293 | 32.261818 | 204 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Pendulum-CFGNODE-post.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import jax.numpy as jnp
import... | 18,719 | 32.074205 | 219 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Spring-GNODE-post.py | ################################################
################## IMPORT ######################
################################################
import imp
import json
import sys
import os
from datetime import datetime
from functools import partial, wraps
from statistics import mode
import fire
import jax
import ja... | 20,974 | 33.958333 | 247 | py |
benchmarking_graph | benchmarking_graph-main/scripts/Spring-LGN.py | ################################################
################## IMPORT ######################
################################################
import json
import sys
from datetime import datetime
from functools import partial, wraps
import fire
import jax
import jax.numpy as jnp
import numpy as np
from jax import... | 16,453 | 30.045283 | 162 | py |
benchmarking_graph | benchmarking_graph-main/scripts/psystems/nbody.py | import jax.numpy as jnp
import matplotlib.pyplot as plt
import numpy as np
def get_fully_connected_senders_and_receivers(num_particles: int, self_edges: bool = False,):
"""Returns senders and receivers for fully connected particles."""
particle_indices = np.arange(num_particles)
senders, receivers = np.mes... | 2,826 | 23.37069 | 93 | py |
benchmarking_graph | benchmarking_graph-main/scripts/psystems/npendulum.py | import jax.numpy as jnp
import numpy as np
def pendulum_connections(P):
return (jnp.array([i for i in range(P-1)] + [i for i in range(1, P)], dtype=int),
jnp.array([i for i in range(1, P)] + [i for i in range(P-1)], dtype=int))
def edge_order(P):
N = (P-1)
return jnp.array(jnp.hstack([jnp.arra... | 1,375 | 28.276596 | 92 | py |
benchmarking_graph | benchmarking_graph-main/scripts/psystems/nsprings.py | import jax.numpy as jnp
import matplotlib.pyplot as plt
import numpy as np
def get_fully_connected_senders_and_receivers(num_particles: int, self_edges: bool = False,):
"""Returns senders and receivers for fully connected particles."""
particle_indices = np.arange(num_particles)
senders, receivers = np.mes... | 4,025 | 28.822222 | 111 | py |
CTDE.jl | CTDE.jl-master/doc/source/conf.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# CTDE documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 31 20:57:08 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autog... | 9,417 | 31.253425 | 80 | py |
imbalanceCXR | imbalanceCXR-master/train_model.py | # coding: utf-8
import os,sys, pickle
sys.path.insert(0,".")
import numpy as np
import torch
import torchvision, torchvision.transforms
from imbalanceCXR.configure_datasets import parseDatasets
import random
from imbalanceCXR.train_utils import train
from imbalanceCXR.test_utils import valid_epoch
from imbalanceCXR.u... | 8,990 | 45.107692 | 219 | py |
imbalanceCXR | imbalanceCXR-master/imbalanceCXR/utils.py | import os, sys
sys.path.insert(0,"..")
import torchvision.models as torch_mod
import numpy as np
import torch
import torchxrayvision as xrv
from focal_loss.focal_loss import FocalLoss
from tqdm import tqdm as tqdm_base
from matplotlib import pyplot as plt
def plotBrierMetrics(means, stds, sorted_pathologies, to_plot... | 9,802 | 36.849421 | 96 | py |
imbalanceCXR | imbalanceCXR-master/imbalanceCXR/train_utils.py | import os, sys
sys.path.insert(0,"..")
import pickle
import pprint
import random
from glob import glob
from os.path import exists, join
import numpy as np
import torch
from torch.optim.lr_scheduler import StepLR
from imbalanceCXR.utils import getCriterions, tqdm
from imbalanceCXR.test_utils import valid_epoch
def tr... | 7,923 | 36.201878 | 118 | py |
imbalanceCXR | imbalanceCXR-master/imbalanceCXR/configure_datasets.py | import torchxrayvision as xrv
NIH_IMAGES = "/run/user/1000/gvfs/smb-share:server=lxestudios.hospitalitaliano.net,share=pacs/T-Rx/NIH/"
CHEXPERT_IMAGES = "/run/user/1000/gvfs/smb-share:server=lxestudios.hospitalitaliano.net,share=pacs/T-Rx/CheXpert-v1.0-small"
CHEXPERT_CSV = "/run/user/1000/gvfs/smb-share:server=lxestu... | 2,968 | 40.236111 | 146 | py |
imbalanceCXR | imbalanceCXR-master/imbalanceCXR/test_utils.py | import os, sys
sys.path.insert(0,"..")
import pickle
from os.path import join
import numpy as np
import torch
from sklearn.metrics import roc_auc_score, f1_score, accuracy_score, brier_score_loss, log_loss, roc_curve, precision_recall_curve
from sklearn.calibration import calibration_curve
from sklearn.metrics import... | 16,495 | 45.730878 | 137 | py |
Comp2Comp | Comp2Comp-master/setup.py | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import os
from os import path
from setuptools import find_packages, setup
def get_version():
init_py_path = path.join(path.abspath(path.dirname(__file__)), "comp2comp", "__init__.py")
init_py = open(init_py_path, "r... | 2,240 | 28.103896 | 94 | py |
Comp2Comp | Comp2Comp-master/comp2comp/models/models.py | import enum
import os
from pathlib import Path
from typing import Dict, Sequence
import wget
from keras.models import load_model
class Models(enum.Enum):
ABCT_V_0_0_1 = (
1,
"abCT_v0.0.1",
{"muscle": 0, "imat": 1, "vat": 2, "sat": 3},
False,
("soft", "bone", "custom"),
... | 3,821 | 24.651007 | 110 | py |
Comp2Comp | Comp2Comp-master/comp2comp/contrast_phase/contrast_inf.py | import argparse
import os
import pickle
import sys
import nibabel as nib
import numpy as np
import scipy
import SimpleITK as sitk
from scipy import ndimage as ndi
def loadNiiToArray(path):
NiImg = nib.load(path)
array = np.array(NiImg.dataobj)
return array
def loadNiiWithSitk(path):
reader = sitk.I... | 13,957 | 30.436937 | 121 | py |
Comp2Comp | Comp2Comp-master/comp2comp/muscle_adipose_tissue/data.py | import math
from typing import List, Sequence
import keras.utils as k_utils
import numpy as np
import pydicom
from keras.utils.data_utils import OrderedEnqueuer
from tqdm import tqdm
def parse_windows(windows):
"""Parse windows provided by the user.
These windows can either be strings corresponding to popul... | 5,857 | 26.763033 | 99 | py |
Comp2Comp | Comp2Comp-master/comp2comp/muscle_adipose_tissue/muscle_adipose_tissue.py | import os
from time import perf_counter
from typing import List
import cv2
import h5py
import numpy as np
import pandas as pd
from keras import backend as K
from tqdm import tqdm
from comp2comp.inference_class_base import InferenceClass
from comp2comp.metrics.metrics import CrossSectionalArea, HounsfieldUnits
from co... | 11,794 | 34.42042 | 99 | py |
Comp2Comp | Comp2Comp-master/comp2comp/visualization/detectron_visualizer.py | # Copyright (c) Facebook, Inc. and its affiliates.
import colorsys
import logging
import math
import os
from enum import Enum, unique
from pathlib import Path
import cv2
import matplotlib as mpl
import matplotlib.colors as mplc
import matplotlib.figure as mplfigure
import numpy as np
import pycocotools.mask as mask_ut... | 48,577 | 38.526444 | 100 | py |
Comp2Comp | Comp2Comp-master/comp2comp/utils/dl_utils.py | import subprocess
from keras import Model
# from keras.utils import multi_gpu_model
# from tensorflow.python.keras.utils.multi_gpu_utils import multi_gpu_model
def get_available_gpus(num_gpus: int = None):
"""Get gpu ids for gpus that are >95% free.
Tensorflow does not support checking free memory on gpus.... | 2,610 | 34.767123 | 99 | py |
Comp2Comp | Comp2Comp-master/docs/source/conf.py | # Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master... | 1,598 | 26.568966 | 85 | py |
igmspec | igmspec-master/docs/conf.py | # -*- coding: utf-8 -*-
#
# igmspec documentation build configuration file, created by
# sphinx-quickstart on Fri Nov 13 13:39:35 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | 10,057 | 31.031847 | 80 | py |
neural-splines | neural-splines-main/fit-grid.py | import argparse
import numpy as np
import point_cloud_utils as pcu
import torch
import tqdm
from scipy.ndimage import binary_erosion
from skimage.measure import marching_cubes
from neural_splines import load_point_cloud, point_cloud_bounding_box, fit_model_to_pointcloud, eval_model_on_grid, \
voxel_chunks, points... | 13,776 | 60.231111 | 120 | py |
neural-splines | neural-splines-main/trim-surface.py | import argparse
import numpy as np
import point_cloud_utils as pcu
import torch
from neural_splines.geometry import point_cloud_bounding_box
def main():
argparser = argparse.ArgumentParser()
argparser.add_argument("input_points", type=str)
argparser.add_argument("mesh", type=str)
argparser.add_argum... | 2,884 | 47.083333 | 120 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.