Skip to content

Instantly share code, notes, and snippets.

View ghamarian's full-sized avatar

Amir Ghamarian ghamarian

View GitHub Profile
def plot_model_training(model_history):
fig, axs = plt.subplots(1,2,figsize=(15,5))
# summarize history for accuracy
axs[0].plot(range(1,len(model_history.history['acc'])+1),model_history.history['acc'])
axs[0].plot(range(1,len(model_history.history['val_acc'])+1),model_history.history['val_acc'])
axs[0].set_title('Model Accuracy')
axs[0].set_ylabel('Accuracy')
axs[0].set_xlabel('Epoch')
axs[0].set_xticks(np.arange(1,len(model_history.history['acc'])+1),len(model_history.history['acc'])/10)
axs[0].legend(['train', 'val'], loc='best')
-Learn-Artificial-Intelligence-with-TensorFlow
origin https://github.com/PacktPublishing/-Learn-Artificial-Intelligence-with-TensorFlow.git (fetch)
-----------------
Advanced-Deep-Learning-with-Keras
origin https://github.com/PacktPublishing/Advanced-Deep-Learning-with-Keras.git (fetch)
-----------------
Deep-Learning-with-Keras
origin https://github.com/PacktPublishing/Deep-Learning-with-Keras.git (fetch)
-----------------
Distributed-Deep-Learning
@ghamarian
ghamarian / gist:f968d85bcfe7e007624f9ce7285b2d14
Last active March 8, 2019 22:09
Deep learning cookbooks
-Learn-Artificial-Intelligence-with-TensorFlow
origin https://github.com/PacktPublishing/-Learn-Artificial-Intelligence-with-TensorFlow.git (fetch)
-----------------
Advanced-Deep-Learning-with-Keras
origin https://github.com/PacktPublishing/Advanced-Deep-Learning-with-Keras.git (fetch)
-----------------
Deep-Learning-with-Keras
origin https://github.com/PacktPublishing/Deep-Learning-with-Keras.git (fetch)
-----------------
Ensemble-Machine-Learning
-Learn-Artificial-Intelligence-with-TensorFlow
origin https://github.com/PacktPublishing/-Learn-Artificial-Intelligence-with-TensorFlow.git (fetch)
-----------------
Ensemble-Machine-Learning
origin https://github.com/PacktPublishing/Ensemble-Machine-Learning.git (fetch)
-----------------
TensorFlow-Machine-Learning-Cookbook-Second-Edition
origin https://github.com/PacktPublishing/TensorFlow-Machine-Learning-Cookbook-Second-Edition.git (fetch)
-----------------
examples
-Learn-Artificial-Intelligence-with-TensorFlow
origin https://github.com/PacktPublishing/-Learn-Artificial-Intelligence-with-TensorFlow.git (fetch)
Ensemble-Machine-Learning
origin https://github.com/PacktPublishing/Ensemble-Machine-Learning.git (fetch)
TensorFlow-Machine-Learning-Cookbook-Second-Edition
origin https://github.com/PacktPublishing/TensorFlow-Machine-Learning-Cookbook-Second-Edition.git (fetch)
examples
origin https://github.com/pytorch/examples.git (fetch)
hands-on-transfer-learning-with-python
origin https://github.com/dipanjanS/hands-on-transfer-learning-with-python.git (fetch)
'''Trains a Siamese MLP on pairs of digits from the MNIST dataset.
It follows Hadsell-et-al.'06 [1] by computing the Euclidean distance on the
output of the shared network and by optimizing the contrastive loss (see paper
for mode details).
# References
- Dimensionality Reduction by Learning an Invariant Mapping
http://yann.lecun.com/exdb/publis/pdf/hadsell-chopra-lecun-06.pdf
@ghamarian
ghamarian / gist:929f337e517531f595d4d3b7b23c4f42
Last active February 20, 2019 12:38
All Tensorflow methods used with their frequencies in tensorflow_cookbook
248 tf.placeholder
203 tf.Variable
151 tf.matmul
143 tf.Session
114 tf.random_normal
113 tf.reduce_mean
101 tf.add
94 tf.global_variables_initializer
91 tf.multiply
89 tf.square
document.addEventListener('DOMContentLoaded', function () {
let selected_color = '#666666';
let white = '#ffffff';
let cy = cytoscape({
// container: $('#cy'), // container to render in
container: document.getElementById('cy'), // container to render in
elements: [ // list of graph elements to start with
{ // node a
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="cytocreator.css"/>
<link rel="stylesheet" href="cytoscape-context-menus.css"/>
</head>
<body>
$('select').on('change', function () {
$(this).find('option').attr('selected', false);
$(this).find(`option[value=${$(this).val()}]`).attr('selected', true);
});