-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multirom #249
base: master
Are you sure you want to change the base?
Conversation
# ddd | ||
|
||
|
||
# if self.n_database == 1 and self.n_reduction == 1: | ||
# self.train_full_database = self.database | ||
# self.reduction.fit(self.database.snapshots_matrix.T) | ||
|
||
# elif self.n_database == 1 and self.n_reduction > 1: | ||
# self.train_full_database = self.database | ||
# for reduction in self.reduction: | ||
# reduction.fit(self.database.snapshots_matrix.T) | ||
|
||
# elif self.n_database > 1 and self.n_reduction == 1: | ||
# self.train_full_database = self.database | ||
# self.reduction = [ | ||
# (k, copy.deepcopy(self.reduction)) | ||
# for k in self.train_full_database | ||
# ] | ||
# print(self.reduction) | ||
# for reduction, database in zip(self.reduction, self.train_full_database): | ||
# self.reduction[reduction].fit(self.train_full_database[database].snapshots_matrix.T) | ||
|
||
# elif self.n_database > 1 and self.n_reduction > 1: | ||
# raise NotImplementedError | ||
# else: | ||
# raise RuntimeError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
# print(self.predict_reduced_database) | ||
# print(self.predict_reduced_database._pairs) | ||
# print(self.predict_reduced_database._pairs[0]) | ||
# print(self.predict_reduced_database._pairs[0][1].values) | ||
|
||
print(self.predict_reduced_database.parameters_matrix) | ||
print(self.approximation.predict( | ||
self.predict_reduced_database.parameters_matrix)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
# print(self.predict_reduced_database) | ||
# print(self.predict_reduced_database._pairs) | ||
# print(self.predict_reduced_database._pairs[0]) | ||
# print(self.predict_reduced_database._pairs[0][1].values) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
# print(self.predict_reduced_database.snapshots_matrix) | ||
# print(self.reduction.inverse_transform( | ||
# self.predict_reduced_database.snapshots_matrix.T).T) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm
# ddd | ||
|
||
|
||
# if self.n_database == 1 and self.n_reduction == 1: | ||
# self.train_full_database = self.database | ||
# self.reduction.fit(self.database.snapshots_matrix.T) | ||
|
||
# elif self.n_database == 1 and self.n_reduction > 1: | ||
# self.train_full_database = self.database | ||
# for reduction in self.reduction: | ||
# reduction.fit(self.database.snapshots_matrix.T) | ||
|
||
# elif self.n_database > 1 and self.n_reduction == 1: | ||
# self.train_full_database = self.database | ||
# self.reduction = [ | ||
# (k, copy.deepcopy(self.reduction)) | ||
# for k in self.train_full_database | ||
# ] | ||
# print(self.reduction) | ||
# for reduction, database in zip(self.reduction, self.train_full_database): | ||
# self.reduction[reduction].fit(self.train_full_database[database].snapshots_matrix.T) | ||
|
||
# elif self.n_database > 1 and self.n_reduction > 1: | ||
# raise NotImplementedError | ||
# else: | ||
# raise RuntimeError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm
# print(self.database) | ||
# print(self.reduction) | ||
# print(self.approximation) | ||
|
||
# from itertools import product | ||
# element_keys = product( | ||
# self.database.keys(), | ||
# self.reduction.keys(), | ||
# self.approximation.keys() | ||
# ) | ||
# self.roms = { | ||
|
||
# tuple(key): { | ||
# 'database': copy.deepcopy(self.database[key[0]]), | ||
# 'reduction': copy.deepcopy(self.reduction[key[1]]), | ||
# 'approximation': copy.deepcopy(self.approximation[key[2]]) | ||
# } | ||
# for key in element_keys | ||
# } | ||
# print(self.roms) | ||
# self._full_database = copy.deepcopy(self.database) | ||
|
||
# # FULL-ORDER PREPROCESSING here | ||
# for plugin in self.plugins: | ||
# plugin.fom_preprocessing(self) | ||
|
||
# self.fit_reduction() | ||
# # self.reduction.fit(self._full_database.snapshots_matrix.T) | ||
# # print(self.reduction.singular_values) | ||
# # print(self._full_database.snapshots_matrix) | ||
# reduced_snapshots = self.reduction.transform( | ||
# self._full_database.snapshots_matrix.T).T | ||
|
||
# self._reduced_database = Database( | ||
# self._full_database.parameters_matrix, reduced_snapshots) | ||
|
||
# # REDUCED-ORDER PREPROCESSING here | ||
# for plugin in self.plugins: | ||
# plugin.rom_preprocessing(self) | ||
|
||
# self.approximation.fit( | ||
# self._reduced_database.parameters_matrix, | ||
# self._reduced_database.snapshots_matrix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm
# def test_constructor_error(self): | ||
# with self.assertRaises(TypeError): | ||
# Database(np.eye(5)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm or substitute
@@ -53,8 +53,9 @@ def test_predict_ref(): | |||
]) | |||
rom.fit() | |||
pred = rom.predict(db._pairs[0][0].values) | |||
print(pred) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm
No description provided.