This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
import tensorflow as tf | |
from tensorflow.keras.layers import Dense, Activation, Input | |
from tensorflow.keras import Model | |
from tensorflow.keras.optimizers import SGD | |
# Implement activation function | |
def dCaAP_activation(x): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Standard imports | |
import numpy as np | |
from sklearn.model_selection import train_test_split | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
import pandas as pd | |
# Keras | |
from keras.layers import Dense | |
from keras.models import Model, Input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def transform_to_template(fn_func, fn_template, save=False): | |
""" | |
Reads (4D)-functional images and transforms directly to template image | |
Inputs: | |
- fn_func : Path to functional images | |
- fn_template : Path to template brain, e.g. MNI template | |
- save : Whether to save transformed image to same folder as functional | |
Outputs: | |
- func_template : functional images transformed to template brain | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Imports | |
import numpy as np | |
from sklearn.datasets import make_blobs | |
import matplotlib.pyplot as plt | |
plt.xkcd(); | |
import seaborn as sns | |
sns.set_style('white') | |
# Set transparency off when exporting / Only if you want to save the figure | |
from matplotlib import patheffects, rcParams | |
rcParams['path.effects'] = [patheffects.withStroke(linewidth=0)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Creates a 3D surface plot, can be used as an example for demonstrating gradient descent | |
Author: Markus Frey | |
E-mail: [email protected] | |
""" | |
import numpy as np | |
import pandas as pd | |
import os | |
import matplotlib.pyplot as plt |