Skip to content

Instantly share code, notes, and snippets.

View vikram-s-narayan's full-sized avatar

Vikram vikram-s-narayan

View GitHub Profile
@vikram-s-narayan
vikram-s-narayan / precogly-cla.md
Created January 15, 2026 10:49
Contributor License Agreement for precogly

Precogly Individual Contributor License Agreement

Thank you for your interest in contributing to Precogly. This Contributor License Agreement ("Agreement") documents the rights granted by contributors to Precogly.

By signing this Agreement, you accept and agree to the following terms and conditions for your present and future Contributions submitted to Precogly. Except for the license granted herein to Precogly and recipients of software distributed by Precogly, you reserve all right, title, and interest in and to your Contributions.

1. Definitions

"You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with Precogly. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor.

@vikram-s-narayan
vikram-s-narayan / gist:15352b020986a247da38a7c201d69dfe
Created December 13, 2022 03:28
Test of GEKPLS with First Datapoint Removed in Test Dataset Generated by GoldenSample from QMC@0.2.19
# The purpose of this gist is to help pinpoint a potential bug in
# QuasiMonteCarlo. This gist shows the working of the GEKPLS surrogate model
# without the potential interferences from other Surrogates dependencies.
# To run the gist and reproduce the results:
# Run this gist with QuasiMonteCarlo@0.2.19; it can be seen that it produces
# far better results without the first data point in the test dataset
# Additional notes:
# - Ensure that no other packages that depend on QuasiMonteCarlo are in your package environment
# - QuasiMonteCarlo@0.2.17 and QuasiMonteCarlo@0.2.18 throw errors. More info for the cause can
# be seen here - https://github.com/SciML/QuasiMonteCarlo.jl/releases/tag/v0.2.17
@vikram-s-narayan
vikram-s-narayan / gekpls_quasi_tests.jl
Created December 6, 2022 12:55
Standalone GEKPLS to help pinpoint bug in QuasiMonteCarlo.jl
# The purpose of this gist is to help pinpoint a potential bug in
# QuasiMonteCarlo. This gist shows the working of the GEKPLS surrogate model
# without the potential interferences from other Surrogates dependencies.
# To run the gist and reproduce the results:
# Run this gist with QuasiMonteCarlo@0.2.16 => all tests pass (evidenced by 3 true prints)
# Then run this gist with QuasiMonteCarlo@0.2.19 => all tests fail in a fashion similar to
# the failing tests of Surogates.jl - https://github.com/SciML/Surrogates.jl/pull/420
# Additional notes:
# - Ensure that no other packages that depend on QuasiMonteCarlo are in your package environment
# - QuasiMonteCarlo@0.2.17 and QuasiMonteCarlo@0.2.18 throw errors. More info for the cause can
@vikram-s-narayan
vikram-s-narayan / vikram-gsoc-report.md
Last active February 1, 2023 20:38
Final Report on GSoC 22 Improvements to Surrogates

Project Details:

Org: SciML-NumFOCUS

Contributor: Vikramaditya Narayan

Mentors: Chris Rackauckas and Ranjan Anantharaman

What Work Was Done:

@vikram-s-narayan
vikram-s-narayan / modified_krg_based.py
Last active July 7, 2022 06:33
Gist to reproduce correlation anomaly between rmse and rlfv in SMT GEKPLS
#Add this line below
#above https://github.com/SMTorg/smt/blob/4a4df255b9259965439120091007f9852f41523e/smt/surrogate_models/krg_based.py#L1165
#to try different theta values
optimal_theta = np.array([0.0001, 0.0001])
optimal_rlf_value, optimal_par = self._reduced_likelihood_function(
theta=optimal_theta
)
@vikram-s-narayan
vikram-s-narayan / comparison_3_dimensions_juliacon.jl
Last active July 6, 2022 06:10
Comparison of GEKPLS on Welded Beam Test with Kriging, RBF and PolyChaos for JuliaCon 2022 Presentation
using Surrogates
using Zygote
using SurrogatesPolyChaos
using SurrogatesAbstractGPs
using AbstractGPs
function vector_of_tuples_to_matrix(v)
#helper function to convert training data generated by surrogate sampling into a matrix suitable for GEKPLS
num_rows = length(v)
num_cols = length(first(v))
@vikram-s-narayan
vikram-s-narayan / comparison_8_dimensions_juliacon.jl
Last active July 5, 2022 07:27
Comparison of GEKPLS on Water Flow Test with Kriging, RBF and PolyChaos for JuliaCon 2022 Presentation
using Surrogates
using Zygote
using SurrogatesPolyChaos
using SurrogatesAbstractGPs
using AbstractGPs
function vector_of_tuples_to_matrix(v)
#helper function to convert training data generated by surrogate sampling into a matrix suitable for GEKPLS
num_rows = length(v)
num_cols = length(first(v))
@vikram-s-narayan
vikram-s-narayan / gekpls_benchmarked.jl
Last active June 22, 2022 15:58
comparison of GEKPLS with RBF and Kriging
using Surrogates
using Zygote
using SurrogatesPolyChaos
function vector_of_tuples_to_matrix(v)
#helper function to convert training data generated by surrogate sampling into a matrix suitable for GEKPLS
num_rows = length(v)
num_cols = length(first(v))
K = zeros(num_rows, num_cols)
for row in 1:num_rows
@vikram-s-narayan
vikram-s-narayan / GEKPLS_V1.jl
Created May 26, 2022 13:36
First attempt at GEKPLS
using Statistics
using ScikitLearn
using LinearAlgebra
@sk_import cross_decomposition: PLSRegression
####### START OF ALL FUNCTIONS ##########
function _ge_compute_pls(X, y, n_comp, grads, delta_x, xlimits, extra_points)
"""
using LinearAlgebra
using ExtendableSparse
Base.copy(t::Tuple) = t
mutable struct RadialBasis{F,Q,X,Y,L,U,C,S,D} <: AbstractSurrogate
phi::F
dim_poly::Q
x::X
y::Y