Want to create flow arrows and export them to VTK - flopy

I was able to import a model from a MODFLOW 6 simulation to FloPy and export it to VTK files, but I need to generate flow vectors to be able to visualize them, is there any way to do that with FloPy?

Related

Pycaret - How to tune data preprocessing steps?

It's easy to tune model hyperparameters in pycaret with tune_model but how are you supposed to tune the data preprocessing hyperparameters?
You need to call setup before you create a model but it is in setup where you define these values.
Let's say I want to compare the effects of standardizing my data vs. normalizing it. Is there a way to do this built into pycaret? I could write my own loops or processing pipelines... but that seems to against the low-code ethos of the library...

In Kaggle, where can I store common code to be imported into multiple Notebooks?

I am working on the Kaggle HuBMAP competition. My application consists of several components -- Preprocessing, Training, Prediction and Scoring -- and there is common code that is used by more than one component. Currently, I put multiple copies of the common code in the Notebooks for each of the components, but I'd like to maintain one copy of the common code that I can import into my application components.
My question is: Where do I store that common code so that it can be imported? Does it go in a separate DataSet? Or a separate Notebook? How do I store it? How do I import it?
Figured out how to do it:
Create a file like common_code.py to hold the code you want to import in Kaggle
Create a Kaggle DataSet like CommonCode and upload common_code.py to it
In the Notebook where you want to import the common code add the DataSet CommonCode
At the top of your Notebook, add the following code:
import sys
sys.path.append( "/kaggle/input/CommonCode" )
Then, at any subsequent point in the Notebook you can say
from common_code import *
While this shows an example of a single import-able file, you can use it for any number of files, and you can update the DataSet for additions or revisions.

Can I combine two ONNX graphs together, passing the output from one as input to another?

I have a model, exported from pytorch, I'll call main_model.onnx. It has an input node I'll call main_input that expects a list of integers. I can load this in onnxruntime and send a list of ints and it works great.
I made another ONNX model I'll call pre_model.onnx with input pre_input and output pre_output. This preprocesses some text so input is the text, and pre_output is a list of ints, exactly as main_model.onnx needs for input.
My goal here is, using the Python onnx.helper tools, create one uber-model that accepts text as input, and runs through my pre-model.onnx, possibly some connector node (Identity maybe?), and then through main_model.onnx all in one big combined.onnx model.
I have tried using pre_model.graph.node+Identity connector+main_model.graph.node as nodes in a new graph, but the parameters exported from pytorch are lost this way. Is there a way to keep all those parameters and everything around, and export this one even larger combined ONNX model?
This is possible to achieve albeit a bit tricky. You can explore the Python APIs offered by ONNX (https://github.com/onnx/onnx/blob/master/docs/PythonAPIOverview.md). This will allow you to load models to memory and you'll have to "compose" your combined model using the APIs exposed (combine both the GraphProto messages into one - this is easier said than done - you' ll have to ensure that you don't violate the onnx spec while doing this) and finally store the new Graphproto in a new ModelProto and you have your combined model. I would also run it through the onnx checker on completion to ensure the model is valid post its creation.
If you have static size inputs, sclblonnx package is an easy solution for merging Onnx models. However, it does not support dynamic size inputs.
For dynamic size inputs, one solution would be writing your own code using ONNX API as stated earlier.
Another solution would be converting the two ONNX models to a framework(Tensorflow or PyTorch) using tools like onnx-tensorflow or onnx2pytorch. Then pass the outputs of one network as inputs of the other network and export the whole network to Onnx format.

Analyzing the operations of a savedmodel in tensorflow 2.0

I need to write a program that loads a pretrained model in SavedModel format and analyzes the types of operations present in the graph.
In TF1 I used graph.get_operations() to get the list of all nodes and I could even modify the graph using tf.contrib.graph_editor. In TF2 these APIs don't work anymore: the list of operations doesn't provide useful information (I can't distinguish a Matmul from an Add node for example) and the tf.contrib.graph_editor has been deleted.
I know that in TF2 I can still "explore" the model visually with tensorboard and/or the debugger, but I need to write a program that can do this analysis automatically.
Is there any way to do that using python?
Thank you.

How do I import 3ds models into JAVAFX?

Here are the loaders, but I can't find an example of how to use the code on the internet. I have plenty of models as I'm a 3d modeler, but I don't know how to use the following link to import my 3ds models into javafx. Any help would be appreciated. Thanks.
http://www.interactivemesh.org/models/jfx3dimporter.html
Use the InteractiveMesh 3D Model Browser to load your model.
This will allow you to check that the 3D Model Importer and JavaFX 3D are capable of loading and rendering your 3ds model. This is a worthwhile check as both the 3D model importer and the JavaFX 3D API are currently early access releases which may have some issues or limitations displaying your particular models.
If the model browser application works with your models and you want to import the 3ds models into your own program, you could adapt a variation the answer to: How to create 3d shape from STL in JavaFX 8? As that answer deals with STL files, to import a 3ds file, substitute the TdsModelImporter for the STL importer. The rest of the test harness code remains the same (making appropriate adjustments for lighting, model scale, etc).
The interactive mesh model importer download includes api javadoc on usage of the TdsModelImporter for 3ds models.
For further questions, I advise you to contact InteractiveMesh directly.
To use the InteractiveMesh 3D Model Browser to load your 3Ds model.
ModelImporter tdsImporter = new TdsModelImporter();
tdsImporter.read(fileUrl);
Node[] tdsMesh = (Node[]) tdsImporter.getImport();
tdsImporter.close();

Resources