Skip to content

Instantly share code, notes, and snippets.

View andersx's full-sized avatar
🤓
LFG

Anders Steen Christensen andersx

🤓
LFG
View GitHub Profile
@andersx
andersx / lmo.inp
Created April 23, 2019 10:52
GAMESS LMO inputfiel
$system
mwords=250
$end
$contrl
scftyp=rhf
runtyp=energy
local=ruednbrg
mplevl=0
@andersx
andersx / test_fchl_energy.py
Created April 15, 2019 09:15
KRR and OQML energy regression tests
from __future__ import print_function
import os
import csv
import ast
from copy import deepcopy
import scipy
@andersx
andersx / deamon.conf
Created February 11, 2019 16:10
Sample ~/.config/pulse/daemon.conf for HQ audio
default-sample-format = float32le
default-sample-rate = 96000
alternate-sample-rate = 96000
default-sample-channels = 2
default-channel-map = front-left,front-right
default-fragments = 2
default-fragment-size-msec = 125
resample-method = speex-float-5
enable-lfe-remixing = no
high-priority = yes
@andersx
andersx / mp_loop_example.py
Created January 31, 2019 14:40
Multiprocessing loop example
def multiprocessing_func(pids, compounds_list, rd):
for i in pids:
rep_out = generate_fchl_acsf(
compounds[i].nuclear_charges,
compounds[i].coordinates,
**rep_params)
rd[i] = rep_out
manager = mp.Manager()
@andersx
andersx / test_svd.py
Last active January 25, 2019 17:24
Test SVD from QML
#!/usr/bin/env python3
from __future__ import print_function
import numpy as np
import qml
from qml.math import svd_solve
from time import time
from scipy.linalg import lstsq
@andersx
andersx / alchemy_example.py
Created December 6, 2018 10:32
Example for numerical alchemical derivatives with the FCHL representation in QML.
#!/usr/bin/env python
from __future__ import print_function
import numpy as np
import qml
import qml.fchl
from qml.fchl import generate_representation
@andersx
andersx / test_l1reg.py
Created December 6, 2018 09:23
Example for L-BFGS-B optimization of L1 regularization in kernel regression.
# MIT License
#
# Copyright (c) 2017 Anders Steen Christensen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@andersx
andersx / to_lapack.f90
Created October 31, 2018 09:16
to_lapack.f90
do i = 1, n
partial(:) = get_partial(i)
do j = 1, n
k(j, i) = k(j, i) + dot_product(partial(:), deriv(:, j))
enddo
@andersx
andersx / pytorch.txt
Last active October 24, 2018 13:58
install pytorch ubuntu 18.04
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-396 nvidia-modprobe
sudo reboot now
#Test with
nvidia-smi
# Install Nvidia drivers from apt with Ubuntu 18.04
sudo ubuntu-drivers autoinstall
@andersx
andersx / kpca.py
Last active October 18, 2018 09:19
Kernel PCA for QML kernels (ndarray)
import numpy as np
import scipy
def kpca(K, n=2, centering=True):
assert K.shape[0] == K.shape[1], "Square matrix required for Kernel PCA."
assert np.allclose(K, K.T, atol=1e-8), "Symmetric matrix required for Kernel PCA."
# First center kernel.