Skip to content
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

How to use the uniform sampling strategy in DeepXDE? #1882

Closed
EigenvectorOfFate opened this issue Nov 12, 2024 · 3 comments
Closed

How to use the uniform sampling strategy in DeepXDE? #1882

EigenvectorOfFate opened this issue Nov 12, 2024 · 3 comments

Comments

@EigenvectorOfFate
Copy link

EigenvectorOfFate commented Nov 12, 2024

Hello everyone,

I wonder how to use the uniform sampling strategy in DeepXDE?
I attempted to use the following code to get the uniform points to train the model. However, with the uniform_points function will return a numpy array other than <deepxde.geometry.timedomain.GeometryXTime>.

num_domain = 10080
geom = dde.geometry.Interval(0, 2*math.pi)
timedomain = dde.geometry.TimeDomain(0, 4)
geomtime = dde.geometry.GeometryXTime(geom, timedomain).uniform_points(num_domain)
@EigenvectorOfFate
Copy link
Author

data = dde.data.TimePDE(geomtime, pde, [bc, ic], num_domain=num_domain, num_boundary=1000, num_initial=1000)

AttributeError: 'numpy.ndarray' object has no attribute 'dim'

@vl-dud
Copy link
Contributor

vl-dud commented Nov 13, 2024

Use train_distribution:

num_domain = 10080
geom = dde.geometry.Interval(0, 2*math.pi)
timedomain = dde.geometry.TimeDomain(0, 4)
geomtime = dde.geometry.GeometryXTime(geom, timedomain)
data = dde.data.TimePDE(
	geomtime, 
	pde, 
	[bc, ic], 
	train_distribution="uniform", 
	num_domain=num_domain, 
	num_boundary=1000, 
	num_initial=1000
)

@EigenvectorOfFate
Copy link
Author

I see. Thank you so much!

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

No branches or pull requests

2 participants