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
| import numpy as np | |
| import networkx as nx | |
| import matplotlib.pyplot as plt | |
| #embedding_coords = nx.spring_layout(G) | |
| embedding_coords = nx.graphviz_layout(G) | |
| #embedding_coords = nx.spectral_layout(G) | |
| #embedding_coords = nx.random_layout(G) | |
| # stored_coords = nx.get_node_aattributes(G, 'embedding') | |
| # for k,v in stored_coords.iteritems(): |
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
| % Some useful tips | |
| % Ref: http://emacsclub.github.io/html/matlab.html | |
| % There are some other http://emacsclub.github.io/html/index.html | |
| % http://ubcmatlabguide.github.io/html/gettingStarted.html | |
| % Check if a parameter called 'arg1' of a function exists | |
| if ~exist('arg1','var') || isempty(arg1) | |
| disp(arg1) | |
| 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
| # Do not use ax.set_xticks([]), instead | |
| ax.get_xaxis().set_visible(False); | |
| # When having a bunch of plots in a grid (via subplots or gridspec), | |
| # we can plot the title as the ylabel of the left-most plot. | |
| # http://matplotlib.org/users/text_props.html | |
| ax.set_ylabel('<text_of_the_title>', rotation = 'horizontal', horizontalalignment = 'right'); |
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
| import inspect # for line number | |
| import re # for extracting debug information | |
| _check_expr_regex = re.compile('THEANO_CHECK_EXPR\(.+\)') | |
| def THEANO_CHECK_EXPR( expr, verbose = False ): | |
| """ | |
| Check the expression | |
| Limited resolution at the line level | |
| """ |
NewerOlder