Skip to content

Instantly share code, notes, and snippets.

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

Vikramaditya Narayan (Vikram) vikram-s-narayan

View GitHub Profile
@vikram-s-narayan
vikram-s-narayan / precogly-cla.md
Last active May 5, 2026 06:12
Contributor License Agreement for precogly

Precogly Contributor License Agreement

Thanks for your interest in contributing to Precogly. This agreement explains the rights you give the OWASP Foundation when you contribute code, docs, or other work to the project. Please read it and accept before your contribution can be merged. Once you accept, this agreement covers this contribution and any future contributions you make to Precogly.

"OWASP" means the OWASP Foundation, Inc., a US 501(c)(3) non-profit that hosts and stewards the Precogly project.

"Precogly" means the Precogly project as hosted by OWASP at github.com/owasp/precogly, including its successors and assigns.

"You" means you personally, or the company you're contributing on behalf of. If you're contributing for a company, that company and its subsidiaries count as one 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