Skip to content

Instantly share code, notes, and snippets.

View mateuszbaran's full-sized avatar

Mateusz Baran mateuszbaran

View GitHub Profile
@mateuszbaran
mateuszbaran / optim-with-manifolds.jl
Created March 16, 2023 08:30
Using Optim.jl with Manifolds.jl
using Manifolds, Optim, ManifoldsBase
# this is a generic part
"""
ManifoldWrapper{TM<:AbstractManifold} <: Optim.Manifold
Adapts Manifolds.jl manifolds for use in Optim.jl
"""
struct ManifoldWrapper{TM<:AbstractManifold} <: Optim.Manifold
M::TM
end
@mateuszbaran
mateuszbaran / results.txt
Last active August 25, 2020 13:10
StaticArrays.jl PR 814 benchmarks
how to read:
* mat-mat: matrix-matrix multiplication
* mat-mat!: in-place matrix-matrix multiplication
* mat-vec: matrix-vector multiplication
* mat-vec!: in-place matrix-vector multiplication
* the number (2/4/10/16): size of matrix
* transpo/adjoint/up-tri/lo-tri etc: structure of the matrix; ident means no wrapper
julia> versioninfo()
Julia Version 1.5.0
Julia Version 1.5.0
Commit 96786e22cc (2020-08-01 23:44 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-9700KF CPU @ 3.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
Environment:
JULIA_EDITOR = "/usr/share/code/code"
@mateuszbaran
mateuszbaran / projekt1.md
Last active March 23, 2020 10:02
Inteligencja obliczeniowa projekt 1

Projekt 1

Projekty można realizować w parach lub samodzielnie. Każda para musi mieć unikalny w obrębie roku zestaw (zestaw danych, algorytm, optymalizowany parametr). Proszę o przesłanie list z wybranymi tematami najpóźniej do 8 marca, w przeciwnym razie 9 marca przygotuję losowy przydział tematów.

Projekty należy oddawać na własnych zajęciach 17 lub 19 marca. Nieusprawiedliwiona nieobecność będzie musiała być odrobiona przez realizację projektu poprawkowego (będzie inny temat), oddawanego pod koniec semestru.

  1. Jeden z zestawów danych:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mateuszbaran
mateuszbaran / zajecia2_rozw.ipynb
Created March 10, 2020 13:52
Laboratorium 2 rozwiązania
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mateuszbaran
mateuszbaran / zajecia3.ipynb
Created March 10, 2020 09:15
Laboratorium 3
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.
abstract type Manifold
end
# Retraction type should be a part of the type of manifold,
# either by different concrete types or a single type with a type parameter
# that selects the retraction type.
retr(M::Manifold, v, x, t=1) = error("Not implemented")
retr!(M::Manifold, y, v, x, t=1) = error("Not implemented")
# just a reasonable default
using LinearAlgebra
using BenchmarkTools
using StaticArrays
using UnsafeArrays
function rv(ar, n)
total = 0.0
for i in 1:n
a = reshape(view(ar, (i-1)*4+1:i*4), (2,2))
total += dot(a, a)