Ticket #36: main.py

File main.py, 1.6 KB (added by flip, 8 years ago)
Line 
1#!/usr/bin/env python
2
3# Python modules
4from __future__ import division
5import pprint
6pp=pprint.pprint
7
8import vespa.common.util.xml_ as util_xml
9import vespa.hlsvd.dist.hlsvd as hlsvd
10
11d = util_xml._file_to_dict("hlsvd_input.xml")
12
13signals = d["signals"]
14n_data_points = d["n_data_points"]
15step_size = d["step_size"]
16matrix_size = d["matrix_size"]
17n_singular_values = d["n_singular_values"]
18n_iterations = d["n_iterations"]
19
20# Change the input values here. Most combinations work.
21n_data_points = 1200
22n_singular_values = 20
23
24# Here's some combinations known to fail with this input data.
25
26# With n_singular_values = 20, I tested every value between ~400 and 1500.
27# The following values failed:
28# n_data_points =  546
29# n_data_points = 1375
30# n_data_points = 1440
31# n_data_points = 1444
32# n_data_points = 1445
33# n_data_points = 1449
34# n_data_points = 1452
35# n_data_points = 1456
36# n_data_points = 1458
37# n_data_points = 1470
38# n_data_points = 1472
39# n_data_points = 1485
40# n_data_points = 1496
41# n_data_points = 1500
42
43# With n_singular_values = 30, I tested every value between ~400 and 1425.
44# The following values failed:
45# n_data_points =  546
46# n_data_points = 1274
47# n_data_points = 1375
48# n_data_points = 1425
49
50t = hlsvd.hlsvd(signals, n_data_points, step_size, matrix_size, 
51                n_singular_values, n_iterations)
52
53# Here's the code I used to test a range of values:
54# for n_data_points in range(1, 2049):
55#     if (n_data_points - n_singular_values) > matrix_size:
56#         print "testing %d..." % n_data_points
57#         t = hlsvd.hlsvd(signals, n_data_points, step_size, matrix_size,
58#                         n_singular_values, n_iterations)