

I have a challenging transform I'm trying to accomplish as I try to improve the performance of my 3D GAN.
Background:
I've been working with data from Berkeley's PEER Ground Motion Database to generate new novel seismic traces. (Real traces shown above.) Coming from a background in engineering my initial attempt involved decomposing the traces into their {X,Y,Z} components, however, the results were less than satisfying, and were subject to repeated mode collapse. There might be ways to fix this with more time and resources but I thought I would try another approach first.


Goal:
I still have a bit of time to work with data, and was looking to solicit methods of turning this {X,Y,Z} point data into something more digestible by a 3D convolutional network. Each of the 788 traces is scaled {-1,1) across all axis and interpolated to 4000 steps. An example of one of the training samples can be seen here in a git Gist link. My knowledge of the subject matter suggests I need to transform this data into some type of array with places a True
if there is a trace point there and False
if void. My idea is that once that region keys and boolean values are computed I will render them.
Problem
I couldn't find away to do this strictly numerically like I have previous with 2D histograms with thousands of bins and tens of thousands of points. Nothing jumped out at me immediately on the Volume Rendering guide but there might be users with more experience in that area. Right now my code is working but slow on the account of having to process through divisions
^3 regions. AnyTrue
stops processing through the points as soon as it finds one regional member, but the cubic rise in computation is a problem, especially if I'd like to keep the resolution high like the original data. Even 10x10x10 divisions is taking way too long to be practical, and is not an amenable approach to processing 788 examples.
dividedVolumes[steps_Integer] :=
Module[{var, sidelength, div, shape},
sidelength = 2/(steps - 1);
div = ((Abs[-1 + sidelength/2]) + (1 - sidelength/2))/(steps - 1);
var = Tuples[
Range[-1 + div/2, 1 - div/2, div], 3
];
If[Power[steps, 3] != Length@var,
Print[Style["Make Ordered Grid Warning", Red, 20]], Nothing];
shape = Cube[#, div] & /@ var;
Region /@ shape
]
checkRegion[reg_, pts_] := Return[
<|reg -> AnyTrue[pts, RegionMember[reg, # ] & ]|>
]
processTrace[rawSet_] := Module[{vol, set, steps = 10},
vol = dividedVolumes[steps];
set = rawSet[[All, {"x", "y", "z"}]] // Values;
checkRegion[#, set] & /@ vol
]
processTrace[testset] // inputed linked code snippet
I'm a bit overwhelmed about where to take this code next if anyone has any suggestions about how to transform this type of trace data. Are there any similar problems I can adopt strategies from?
Rescale
to {{-1,1},{-1,1},{-1,1}} space. $\endgroup${wx,wy,wz} = Transpose[Differences[Values[data][[All, 2 ;;]]]]
then maybe{fx,fy,fz} = FourierDCT[#,1]&/@{wx,wy,wz}
. You want the DCT because it's real valued, and type-I DCT so it's easily invertible with another type-I DCT. $\endgroup$