Skip to content

Instantly share code, notes, and snippets.

View gerritgr's full-sized avatar

Gerrit gerritgr

  • Saarland University
View GitHub Profile

How to Thesis 📘

The process of writing a thesis is an important and transformative phase for every student. It can illuminate new knowledge and perspectives but also trigger stress and doub. Howver, physical and mental well-being should always be prioritized and never sacrificed for the sake of university obligations. This guide aims to streamline the process by providing you with practical guidelines to navigate this challenging yet rewarding endeavor.

General 📌

  • Most communication should run via Mattermost (I recommend you turn on Mattermost email notifications to not miss anything. We also expect you to try to respond to messages within two working days). Online meetings are typically organized in MS Teams. Feel free to proactively create meetings and invite people. 
  • You must attend the group seminar ("Bachelorseminar" or "Masterseminar"), for more information see https://mcms.cs.uni-saarland.de/bama/ (there will be a mailing list in the future).
  • Please carefully read the "Prüfungsordnung" (st
@gerritgr
gerritgr / t033_molecular_representation.ipynb
Created December 6, 2022 11:38
T033_molecular_representation.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
!pip install tensorboard
##
from torch.utils.tensorboard import SummaryWriter
writer = SummaryWriter('runs/molecules')
##
writer.add_scalar("Loss/train", 3.0, 1)
@gerritgr
gerritgr / lumpy.ipynb
Created March 15, 2022 15:02
Lumpy.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Model:
- States: ["S", "I"]
- Rules:
# rules haben immer die Form "X->Z: rate" oder "X+Y->X+Z: rate" und eine reaction rate constant >=0
- Recovery: "I" -> "S": 1.0
- Infection: "I"+"S" -> "I"+"I": 0.3
Network:
# reicht wenn wir uns zuerst auf statische, undir. graphen ohne self-loops konzentrieren
- Edges: [(0,1),(1,2),(2,0),(0,3)]
# Install on os x
brew install pipenv
# Init (automatically detects and converts requiremetns.txt)
pipenv install
# after that you can simply change python version in Pipfile if desired
# install packages
pipenv install -r requirements.txt
@gerritgr
gerritgr / scipy_dist_clustering.py
Created March 20, 2019 09:27
Hierarchical Clustering from distance function
def cluster_from_distances(data_points, dist_func, cluster_num):
from scipy.cluster.hierarchy import linkage, cut_tree
points = list()
for d1 in data_points:
d_list = [dist_func(d1,d2) for d2 in data_points]
points.append(d_list)
import scipy.spatial.distance as ssd
points = ssd.squareform(points)
Z = linkage(points, 'ward')
def timeit(method):
import time
def timed(*args, **kw):
start = time.time()
print('start method: '+method.__name__ )
result = method(*args, **kw)
end = time.time()
diff = int(end - start)
print('end method: ' + method.__name__,' elapsed: '+str(diff)+'sec')
return result
_Simple: Keynote_
1) drag and drop pyplot (pdf export) or compiled latex (as pdf) or standard latex (via keynote equation editor or latexit) into keynote
2) do whateva editing in keynote
3) Export as PDF and crop somehow
_Edit in Illustrator or Affinity Designer_
1) Export as PDF
2) in some cases (when you want to convert text to paths): convert pdf to svg and back to pdf
3) open in illustrator or affinity
(there also seems to be a trick to create canvas first and then imoprt pdf, maybe also conversion through keynote works)