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
""" | |
Simple example of using pytorch to build a linear regression model. | |
""" | |
import torch | |
from torch.autograd import Variable | |
from torch import optim | |
import sys |
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
class UCSD(Dataset): | |
"""UCSD pedestrian counting data.""" | |
def __init__(self, data_dir, annotation_dir, transform=None): | |
self.file_list = [] | |
self.file_cnts = [] | |
files = glob.glob( | |
os.path.join( |
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
int g(int x, int y) { | |
if (y > 0) | |
return g(x, y - 1) + 1 ; | |
else | |
return x; | |
} | |
int main() { | |
int a; |
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
int a = 1111; | |
int main() { | |
a = 3333; | |
} |
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
int f(int a, int b, int c) | |
{ | |
int c; | |
c = a + b; | |
return c; | |
} | |
int main() | |
{ | |
int a; |
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
function [pos_ev_idx,neg_ev_idx,seed,data] = test_negative_type_simple(options) | |
% TEST_NEGATIVE_TYPE_SIMPLE evaluate the eigenvalues of Gram matrices | |
% | |
% This function evaluates the number of positive/negative eigenvalues | |
% of the Gram matrix M, either constructed from the (1) q-Wasserstein | |
% distance or (2) the bottleneck distance. | |
% | |
% Both distances lead to nonnegative (symmetric) Gram matrices and | |
% the question is if the Gram matrices are (conditionally) negative | |
% definite (see suppl. material). |
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
2014-09-29 09:29:04 +0200 | |
make | |
all | |
clang -O -c -o vecLibFort.o vecLibFort.c | |
clang -shared -O -DVECLIBFORT_INTERPOSE -o libvecLibFortI.dylib -O vecLibFort.c \ | |
-Wl,-reexport_framework -Wl,Accelerate \ | |
-install_name /usr/local/lib/libvecLibFortI.dylib | |
ar -cru libvecLibFort.a vecLibFort.o |
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
2014-09-29 09:29:04 +0200 | |
make | |
all | |
clang -O -c -o vecLibFort.o vecLibFort.c | |
clang -shared -O -DVECLIBFORT_INTERPOSE -o libvecLibFortI.dylib -O vecLibFort.c \ | |
-Wl,-reexport_framework -Wl,Accelerate \ | |
-install_name /usr/local/lib/libvecLibFortI.dylib | |
ar -cru libvecLibFort.a vecLibFort.o |
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
"""kw-techtip-04-03-2013-p1.py | |
Simple example of how to construct a graph from a {0,1} adjacency matrix and a | |
file with vertex labels. | |
Usage | |
----- | |
$ python kw-techtip-04-03-2013-p1.py <AdjacencyFile> <LabelFile> | |
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
"""kw-techtip-04-03-2013-p2.py | |
Fine-structure analysis of a graph. | |
Usage | |
----- | |
Assuming that the file "graph.txt" generated by kw-techtip-04-03-2013-p1.py | |
resides in "/tmp", run | |
NewerOlder