Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 844989a4 authored by hhakim's avatar hhakim
Browse files

Update the python script plotting sparse faust size (bytes) versus RC.

It's because of past API evolution in FaustFactory.rand().
Updated the plotting layout too.
parent 4cdc56a0
Branches
Tags
No related merge requests found
from pyfaust import Faust from pyfaust import Faust, FaustFactory
import numpy as np import numpy as np
import os import os
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
...@@ -15,8 +15,8 @@ if __name__ == '__main__': ...@@ -15,8 +15,8 @@ if __name__ == '__main__':
for i, d in zip( for i, d in zip(
list(range(0, ntests)), list(range(0, ntests)),
np.linspace(startd, endd, ntests)): np.linspace(startd, endd, ntests)):
F = Faust.randFaust(nfactors, F = FaustFactory.rand(nfactors,
[min_dim_sz, max_dim_sz], d) [min_dim_sz, max_dim_sz], d, fac_type='sparse')
filepath = 'test_faust_size'+str(i)+'.mat' filepath = 'test_faust_size'+str(i)+'.mat'
F.save(filepath) F.save(filepath)
stat = os.stat(filepath) stat = os.stat(filepath)
...@@ -28,5 +28,6 @@ if __name__ == '__main__': ...@@ -28,5 +28,6 @@ if __name__ == '__main__':
plt.xlabel('Relative Complexity/Density') plt.xlabel('Relative Complexity/Density')
plt.ylabel('File Size (bytes)') plt.ylabel('File Size (bytes)')
#plt.scatter(rcs, sizes, s=1) #plt.scatter(rcs, sizes, s=1)
plt.tight_layout()
plt.plot(rcs, sizes) plt.plot(rcs, sizes)
plt.show() plt.show()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment