Skip to content

Instantly share code, notes, and snippets.

View IvanYashchuk's full-sized avatar

Ivan Yashchuk IvanYashchuk

View GitHub Profile
@IvanYashchuk
IvanYashchuk / poisson.jl
Last active April 29, 2021 21:29
FEniCS solver + Zygote.jl + Turing.jl
using PyFenicsAD
using Zygote
using PyCall
using Turing
import LinearAlgebra: norm
using Random, Distributions
fenics = pyimport("fenics")
fenics.set_log_level(fenics.LogLevel.ERROR)
fa = pyimport("fenics_adjoint")
@IvanYashchuk
IvanYashchuk / ex3.c
Last active May 23, 2020 13:20
Failing adjoint. Run with ./ex3 -use_ifunc -ts_monitor -ts_adjoint_monitor -ts_type theta -ts_theta_theta 1.0
static char help[] ="Solves a simple time-dependent linear PDE (the heat equation).\n\
Input parameters include:\n\
-m <points>, where <points> = number of grid points\n\
-time_dependent_rhs : Treat the problem as having a time-dependent right-hand side\n\
-use_ifunc : Use IFunction/IJacobian interface\n\
-debug : Activate debugging printouts\n\
-nox : Deactivate x-window graphics\n\n";
/*
@IvanYashchuk
IvanYashchuk / heat-adjoint.py
Created May 22, 2020 13:08
petsc4py's heat example with calls to TS Adjoint
# Solves Heat equation on a periodic domain, using raw VecScatter
from __future__ import division
import sys, petsc4py
petsc4py.init(sys.argv)
from petsc4py import PETSc
from mpi4py import MPI
import numpy
class Heat(object):
@IvanYashchuk
IvanYashchuk / standalone-shared-lib.make
Created April 16, 2020 10:10
Makefile for Stan Math standalone shared library
# makefile to be used for standalone compliation of
# C++ programs. Note that the dependend libraries
# must be compiled first by the math-libs target
#
# Example for hello-math.cpp C++ program:
#
# make -f path/to/math/make/standalone math-libs
# make -f path/to/math/make/standalone hello-math
#
# in case this makefile is used within another makefile
@IvanYashchuk
IvanYashchuk / report.md
Last active September 21, 2023 22:00
Google Summer of Code (GSoC) 2019 project report
@IvanYashchuk
IvanYashchuk / GPR-ChainerX.ipynb
Last active August 12, 2019 12:56
ChainerX Gaussian Process Regression
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.