Skip to content

Instantly share code, notes, and snippets.

View ConsciousMachines's full-sized avatar
👾

ConsciousMachines

👾
View GitHub Profile
@ConsciousMachines
ConsciousMachines / market_hedge_pca.ipynb
Last active March 15, 2025 01:03
Hedging Market Trend with PCA
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ConsciousMachines
ConsciousMachines / retirement_portfolio_simulation.ipynb
Created August 7, 2024 06:19
Retirement Portfolio Simulation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ConsciousMachines
ConsciousMachines / numpy_2_cuda.py
Created June 24, 2024 19:22
Process NumPy array with CUDA
# send NumPy array data to CUDA code
# =============================================================================
# =============================================================================
# MAIN LESSONS:
# 1. python natively provides "buffer protocol" which is interface to C array
# 2. numpy supports this, and offers you a ptr to the C array data
# 3. use ctypes as native interface to C libraries, send them the ptr
# 4. no point using other tools as they all break with updates
# 5. for cuda, compile it as an extern C shared object
# need to restart python each time .so changes to reimport w ctypes
@ConsciousMachines
ConsciousMachines / Scotiabank_DSDD.ipynb
Last active March 24, 2024 06:09
2nd place Scotiabank Data Science Discovery Days 2024 Hackathon
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ConsciousMachines
ConsciousMachines / statistical_consulting.ipynb
Last active April 3, 2024 22:34
Statistical Consulting
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ConsciousMachines
ConsciousMachines / JAX_Options_Pricing.ipynb
Created March 10, 2024 04:15
Pricing Options with JAX numpy
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ConsciousMachines
ConsciousMachines / domain_adaptation.ipynb
Last active March 25, 2025 15:49
Domain Adaptation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ConsciousMachines
ConsciousMachines / Main.cpp
Last active September 26, 2023 18:32
basic ImGui + CUDA + OpenGL
// based on https://gist.github.com/kamino410/09df4ecdf37b03cbd05752a7b2e52d3a
// this adds ImGui to an application with CUDA and OpenGL. the thing is, once you use CUDA, ImGui renders very strangely.
// after 9 hours of debugging I found that putting glBindBuffer before and after the draw call fixes this!
//glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo); // THE MAGIC LINE #1
//glDrawPixels(WIDTH, HEIGHT, GL_RGBA, GL_UNSIGNED_BYTE, 0);
//glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); // THE MAGIC LINE #2
#include "imgui/imgui.h" // version 1.78 and 1.60
#include "imgui/imgui_impl_glfw.h"