Skip to main content

Phidnet

Project description

Phidnet


1. Introduction to phidnet

  • Phidnet is a library developed for neural network construction and deep learning.

2. Install phidnet


3. Requirements of phidnet

  • numpy
  • matplotlib
  • pandas(Optional)

4. Use phidnet

  • Import phidnet
    • import phidnet
  • Numpy
    • All data, such as matrix and vector, must be converted to numpy array object.
  • Configuration of the Piednet
    • phidnet.activation
    • phidnet.optimizer
    • phidnet.load
    • phidnet.matrix
    • phidnet.set
    • phidnet.one_hot_encode
    • phidnet.model
  • Define activation function
    • Sigmoid = phidnet.activation.Sigmoid()
    • Relu = phidnet.activation.Relu()
    • ect
  • Define optimizer
    • SGD = phidnet.optimizer.SGD(lr=0.01) # lr: learning rate
    • Momentum = phidnet.optimizer.Momentum(lr=0.01, momentum=0.9)
    • AdaGrad = phidnet.optimizer.AdaGrad(lr=0.01)
  • Set data
    • Set input data
      • phidnet.set.input_data(X)
    • Set output data
      • phidnet.set.target_data(T)
  • Set weight and bias
    • phidnet.set.weight(row, column, layer=layer)
    • phidnet.set.bias(column, layer=layer)
    • phidnet.set.weight(2, 10, layer=1) # 2×10 matrix, 1st layer
    • phidnet.set.bias(10, layer=1) # 1×10 matrix, 1st layer
  • Build neural network
    • phidnet.set.build_network(layer)
    • The number of layers is the total number of layers, excluding the input layer. For example, a network with one input layer, one output layer, and one hidden layer in between is a two-layer.
  • Set activation function of neural network
    • phidnet.set.activation_function(function_list)
    • phidnet.set.activation_function([Sigmoid, Sigmoid]) # 1st layer: Sigmoid, 2nd layer: Sigmoid
    • The example is the activation functions of the two-layer and Sigmoid, an element of list, is the instance of phid.activation.Sigmoid() class
  • Fit model
    • phidnet.model.fit(epoch=1000, optimizer=SGD, print_rate=100, save=True)
    • In the example, train the model for epoch. SGD is the instance of phid.optimizer.SGD() class. Every 100 epoch, print the loss, accuracy of model(print rate). If save= is true, save weight and bias in pickle. Default: save=False
  • Predict
    • predicted = phidnet.model.predict(input, exponential=True, precision=2)
    • In the example, the model returns the predicted value in the predicted variable. If exponential= is True, the model returns exponential representation value like 1e-6. When exponential=False, The model returns the value represented by the decimal like 0.018193. The model returns precise values as set to precision. When output is 0.27177211, precision=3, output is 0.271.
  • Load
    • phidnet.load.model('C:\examples')
    • If you set it to save=True and trained the model, there would be a file called saved_weight, saved_bias. If the file is in C:\examples\saved_... , you can load trained weight and bias as in the example.
  • View fitting
    • phid.model.show_fit()
    • It shows a change in loss and accuracy.
  • One hot encoding
    • phidnet.one_hot_encode.encode(number, length=length)
    • phidnet.one_hot_encode.encode(3, length=5) # [0, 0, 0, 1, 0]
    • phidnet.one_hot_encode.encode_array(array, length=length)
    • phidnet.one_hot_encode.encode_array([[1], [2], [3]], length=5) # [[0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 0]]
    • phidnet.one_hot_encode.get_number(one_hot_encoded)
    • phidnet.one_hot_encode.get_number([0, 0, 1, 0, 0]) # 2
  • Matrix operations
    • m = phid.matrix.matrix(list) # It converts the list into a matrix (※ phidnet matrix object. not numpy object)
    • ect.

5. Use phidnet's convolution neural network

  • ect.

6. Example phidnet

  • Refer to examples for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

phidnet-0.0.5.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

phidnet-0.0.5-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file phidnet-0.0.5.tar.gz.

File metadata

  • Download URL: phidnet-0.0.5.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for phidnet-0.0.5.tar.gz
Algorithm Hash digest
SHA256 a11b9da6b6856094b6eaa484c2ba62a51221a9ae7af7e32ed9d679f08d0fb90a
MD5 fc23e807fc21f0bee3a802f08dbad5b8
BLAKE2b-256 b3b4d52243844bd4e087b1f4b3ceae142da2cd15a0e520c5a538c54d9de0b162

See more details on using hashes here.

File details

Details for the file phidnet-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: phidnet-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for phidnet-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b44cc3fdeee1c1d7b7b1c4551e2d6d4dd0ef05a005ee6be1dfa4a19267a267c4
MD5 8b93284ac3de22acfd785059f5a1d0b4
BLAKE2b-256 8ddfb4e6da2a1445bc2d6f63b81dcb60b96f2492ce47555b6a607c2987182d45

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page