- A tensorflow supported python version (3.6-3.8)
- (Optionally) CUDA Drivers for your nvidia GPU
- A TF SavedModel to use
- Run
pip install -r requirements.txt
to install required packages (tensorflow, scipy) - A mat file with an array of proper size named 'x'
This file contains hidden or 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
function y = f(x) | |
y = x.^4 * cos(x) - x.^2 * sin(x.^3); | |
end | |
x = -10:.01:10; | |
y = f(x); | |
plot(x, f(x)) | |
min(y) | |
max(y) |
This file contains hidden or 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
function [mean_per_class, num_fail_students] = courses_calc(data_vec) | |
mean_per_class = mean(data_vec(:).grades, 1); | |
failed_students = data_vec(:).grades > 5; | |
num_fail_students = sum(failed_students, 1); | |
end |
This file contains hidden or 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
function students_calc(data_vec) | |
mean_grades = mean(data_vec(:).grades, 1); | |
file_data = [data_vec(:).name, data_vec(:).surname, mean_grades]; | |
file = fopen('student_mean.txt','w'); | |
fprintf(file,'%s %s %f\n', file_data); | |
fclose(fileID); | |
[argvalue, argmax] = max(mean_grades); | |
best_student_name = data_vec(argmax).name; |
This file contains hidden or 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
class VFELayer(keras.Model): | |
def __init__(self, name='VFELayer', l1=32, l2=32, l3=48, dropout=0, **kwargs): | |
super().__init__(name=name, **kwargs) | |
self.bn_a = keras.layers.BatchNormalization() | |
self.local_mlp_a = keras.layers.Dense(l1, kernel_initializer='glorot_uniform', activation='swish') | |
self.bn_b = keras.layers.BatchNormalization() | |
self.local_mlp_b = keras.layers.Dense(l2, kernel_initializer='glorot_uniform', activation='swish') | |
self.bn_g = keras.layers.BatchNormalization() | |
self.global_mlp = keras.layers.Dense(l3, kernel_initializer='glorot_uniform', activation='swish') |
This file contains hidden or 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
Αγαπητοί συνάδελφοι καλησπέρα σας. Έχω γράψει και διαγράψει παρόμοια μηνύματα αρκετές φορές στο παρελθόν, καθώς ένα μέρος μου θεωρεί άσκοπο το να εκφράσω όσα σκέφτομαι κάθε φορά που βλέπω αντίστοιχη ανακοίνωση του συλλόγου. Όπως έχει πει ο Όσκαρ Ουάιλντ "είμαι πολύ μεγάλος πια για να τα ξέρω όλα", αλλά όχι τόσο μεγάλος ώστε να ξεχάσω ότι υπήρξα στην ηλικία σας και στην "φάση" σας, στην περίοδο που ένοιωθα ότι οι μεγαλύτεροι είναι απογοητευμένοι, συμβιβασμένοι και άλλα -μένοι, και ότι το σύστημα δεν φτιάχνεται, θέλει να διαλυθεί και να χτιστεί από την αρχή. Επιπρόσθετα, είχα την -αμφίβολη- τιμή να ανήκω στην γενιά που παρέλαβε λίγο πριν το πέμπτο της έτος τον λογαριασμό για τις υπερβολές των προηγουμένων γενιών. Μπήκαμε με την πεποίθηση ότι θα βγαίναμε από την σχολή και θα βρίσκαμε δουλειά, και είδαμε την φούσκα να σπάει με τη μορφή κρίσης και ΔΝΤ και να παρασέρνει πολλά σχέδια και όνειρα μαζί. | |
Δυστυχώς, αυτό που παρέμεινε σταθερό είναι η ρητορική των παρατάξεων που, αν τις κρίνω με όσα έμαθα εκ των υστέρων α |
This file contains hidden or 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
class ConcordantPercentage(keras.metrics.Metric): | |
def __init__(self, name='concordant_pct', baseline=1, **kwargs): | |
baseline_suffix = '' if baseline == 1 else f'_{baseline}' | |
_name = f'{name}{baseline_suffix}' | |
super().__init__(name=_name, **kwargs) | |
self.baseline = baseline | |
self.concordant_samples = self.add_weight(name='concordant_samples', shape=(1,), initializer='zeros', dtype=tf.int32) | |
self.num_samples = self.add_weight(name='num_samples', shape=(1,), initializer='zeros', dtype=tf.int32) | |
def update_state(self, y_true, y_pred, **kwargs): |
This file contains hidden or 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
z_prev=0 | |
f_grad_prev=0 | |
v=0 | |
y_prev = 0 | |
d_grad_prev = 0 | |
generated_prev = 0 | |
d_out_prev = 0 | |
print(f'Using m : {self.config.m}') |
This file contains hidden or 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
class MultiHotAccuracy(keras.metrics.Metric): | |
def __init__(self, name='multihot_accuracy', absolute=False, **kwargs): | |
name = f'multihot{"_absolute" if absolute else ""}_accuracy' | |
super().__init__(name=name, **kwargs) | |
self.absolute = absolute | |
self.binary_accuracy = self.add_weight(name='binary_accuracy', shape=(1,), initializer='zeros', dtype=tf.float32) | |
self.num_samples = self.add_weight(name='num_samples', shape=(1,), initializer='zeros', dtype=tf.int32) | |
def update_state(self, y_true, y_pred, **kwargs): |
This file contains hidden or 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
jacobian_generator = tf.reshape( | |
self.gh_jacobian(tf.reshape(generator_output, [self.batch_size, 64* 64 * 3]), self.gi), | |
[self.batch_size, 64, 64, 3, self.z_dim]) |