Skip to content

Conversation

ndem0
Copy link
Member

@ndem0 ndem0 commented Apr 16, 2024

No description provided.

Comment on lines +184 to +209
# 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Comment on lines +264 to +271
# 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))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Comment on lines +279 to +282
# 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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Comment on lines +289 to +291
# print(self.predict_reduced_database.snapshots_matrix)
# print(self.reduction.inverse_transform(
# self.predict_reduced_database.snapshots_matrix.T).T)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm

Comment on lines +628 to +653
# 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm

Comment on lines +662 to +704
# 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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm

Comment on lines +20 to +22
# def test_constructor_error(self):
# with self.assertRaises(TypeError):
# Database(np.eye(5))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm or substitute

])
rom.fit()
pred = rom.predict(db._pairs[0][0].values)
print(pred)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants