Here are a packages to help writing programs in Rust with the functional style.
- fp-core.rs https://github.com/JasonShin/fp-core.rs#lens
For functional programming terminologies, take a look at the following repos.
| import numpy as np | |
| import torch | |
| from torch import nn | |
| from torch import Tensor | |
| from torch.func import functional_call | |
| import torchopt | |
| import matplotlib.pyplot as plt | |
| class SimpleNN(nn.Module): |
| #!/bin/bash | |
| ## Entrypoint for docker RUN directives as well as ENTRYPOINT with conda env | |
| ## Enable by adding: | |
| ## COPY entry.sh ./ | |
| ## SHELL ["/entry.sh", "/bin/bash", "-c"] | |
| ## | |
| ## Optionally, set the following env to select a conda env to run in | |
| ## ENV CONDA_DEFAULT_ENV=foo | |
| ## You may also want to add something like | |
| ## RUN conda init bash && echo 'conda activate "${CONDA_TARGET_ENV:-base}"' >> ~/.bashrc |
| FILES=*.rst | |
| for f in $FILES | |
| do | |
| filename="${f%.*}" | |
| echo "Converting $f to $filename.md" | |
| `pandoc $f -f rst -t markdown -o $filename.md` | |
| done |
| # see: https://www.deepmind.com/blog/article/Competitive-programming-with-AlphaCode | |
| # Why AlphaCode generated an unused variable `c` to store a string that has no use at all? | |
| t = int(input()) | |
| for i in range(t): | |
| s = input() | |
| t = input() | |
| a = [] | |
| b = [] | |
| for j in s: | |
| a.append(j) |
| # First install tmux | |
| brew install tmux | |
| # For mouse support (for switching panes and windows) | |
| # Only needed if you are using Terminal.app (iTerm has mouse support) | |
| Install http://www.culater.net/software/SIMBL/SIMBL.php | |
| Then install https://bitheap.org/mouseterm/ | |
| # More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ |
| import sys | |
| from rdkit import Chem | |
| from rdkit.Chem import AllChem, TorsionFingerprints | |
| from rdkit.ML.Cluster import Butina | |
| def gen_conformers(mol, numConfs=100, maxAttempts=1000, pruneRmsThresh=0.1, useExpTorsionAnglePrefs=True, useBasicKnowledge=True, enforceChirality=True): | |
| ids = AllChem.EmbedMultipleConfs(mol, numConfs=numConfs, maxAttempts=maxAttempts, pruneRmsThresh=pruneRmsThresh, useExpTorsionAnglePrefs=useExpTorsionAnglePrefs, useBasicKnowledge=useBasicKnowledge, enforceChirality=enforceChirality, numThreads=0) | |
| return list(ids) | |
Here are a packages to help writing programs in Rust with the functional style.
For functional programming terminologies, take a look at the following repos.
Here is a list tools for building a functional deep learning software stack.
Here is a list of blogs/tutorials for doing functional machine learning.
-funsafe-loop-optimizations-Wunsafe-loop-optimizations,
the compiler will warn you if it finds this kind of loop.-funsafe-math-optimizations