3ecb4a4df1def4c9496bd676adad3564f746a02d,innerfidelity/innerfidelity_transformation.py,,main,#,19
Before Change
def main():
models = dict()
for file_path in glob("innerfidelity\\transformation\\*"):
file_path = os.path.abspath(file_path)
file_name = os.path.split(file_path)[-1]
file_name = file_name.split(".")[0]
After Change
def main():
models = dict()
for file_path in glob(os.path.join("transformation", "*.jpg")):
print(file_path)
file_path = os.path.abspath(file_path)
file_name = os.path.split(file_path)[-1]
file_name = file_name.split(".")[0]
name, kind = file_name.split("_")
if name not in models:
models[name] = dict()
with open(file_path, "rb") as f:
model = os.path.split(file_path)[-1].split(".")[0]
im = Image.open(file_path)
// Add -1px to left and top, +1px to right and bottom of tight crop box in parse_innerfidelity
fr = ImageGraphParser.parse_cropped(
im,
name=model,
f_min=10,
f_max=20000,
a_min=-50,
a_max=20
)
fr.interpolate()
models[name][kind] = fr
diffs = []
names = []
for model, frs in models.items():
diffs.append(frs["before"].raw - frs["after"].raw)
names.append(model)
diffs = np.vstack(diffs)
diff = np.mean(diffs, axis=0)
f = models[list(models.keys())[0]]["before"].frequency
diff = FrequencyResponse(name="Innerfidelity Transformation", frequency=f, raw=diff)
diff.smooth(window_size=1/9, iterations=10)
diff.raw = diff.smoothed
diff.smoothed = np.array([])
fig, ax = plt.subplots()
legend = []
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: jaakkopasanen/AutoEq
Commit Name: 3ecb4a4df1def4c9496bd676adad3564f746a02d
Time: 2018-07-08
Author: jaakko.o.pasanen@gmail.com
File Name: innerfidelity/innerfidelity_transformation.py
Class Name:
Method Name: main
Project Name: philipperemy/keras-activations
Commit Name: 0bc9d06224686cc32e5cf52f3aae979d3380ca24
Time: 2019-01-03
Author: premy@cogent.co.jp
File Name: examples/mnist.py
Class Name:
Method Name:
Project Name: PyMVPA/PyMVPA
Commit Name: 75a815a236dde2780bd4b09805dd7a0f5fd2d664
Time: 2009-01-27
Author: michael.hanke@gmail.com
File Name: setup.py
Class Name:
Method Name: