Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Calendar Versioning](https://calver.org/) of
the following form: YYYY.0M.0D.

## 2025.11.11

### Added

- Designed kernel and enhanced interfaces for the Artifical Neuron component
- Created an abstract class for Neuron (NeuronSecondary), implementing both common and secondary methods

### Updated

- Changed design to include queues representing each set of weights and inputs
- Fixed naming of interfaces to better match the convention
- Changed some data types within methods in order to better execute the component's function

## 2025.10.17

### Added

- Designed a proof of concept for an Artificial Neuron component

## 2025.09.21

### Added
Expand Down
21 changes: 4 additions & 17 deletions doc/02-component-proof-of-concept/02-component-proof-of-concept.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Portfolio Part 2: Component Proof-of-Concept

- **Name**: <!-- TODO: fill with first and last name (e.g., Brutus Buckeye) then delete this comment -->
- **Dot Number**: <!-- TODO: fill with OSU dot number (e.g., buckeye.17) then delete this comment -->
- **Due Date**: <!-- TODO: fill out with due date and time (e.g., 10/17 @ 3:10 PM EST) then delete this comment -->
- **Name**: Grace Metz
- **Dot Number**: Metz.403
- **Due Date**: 10/9/25

## Assignment Overview

<!-- TODO: read the assignment overview then delete this comment -->

Previously, you brainstormed three ideas, and hopefully you got some feedback as
well. However, it's impossible to know how reasonable your design actually is
without trying to implement it. Because you're only just learning our full
Expand All @@ -30,8 +28,6 @@ the more work you can put in now, the better.

## Assignment Checklist

<!-- TODO: browse the checklist then delete this comment -->

To be sure you have completed everything on this assignment, we have littered
this document with TODO comments. You can browse all of them in VSCode by
opening the TODOs window from the sidebar. The icon looks like a tree and will
Expand All @@ -53,8 +49,6 @@ to the tree diagram (you may remove this one as well):

## Assignment Learning Objectives

<!-- TODO: read the assignment learning objectives then delete this comment -->

Without learning objectives, there really is no clear reason why a particular
assessment or activity exists. Therefore, to be completely transparent, here is
what we're hoping you will learn through this particular aspect of the portfolio
Expand All @@ -68,8 +62,6 @@ project. Specifically, students should be able to:

## Assignment Rubric: 10 Points

<!-- TODO: read the assignment rubric then delete this comment -->

Again, to be completely transparent, most of the portfolio project, except the
final submission, is designed as a formative assessment. Formative assessments
are meant to provide ongoing feedback in the learning process. Therefore,
Expand Down Expand Up @@ -114,8 +106,7 @@ Below is further rationale/explanation for the rubric items above:
> to create a new design. In you do end up picking one at random, you should
> disclose that here as well.

<!-- TODO: briefly argue your choice of design or design something
new; then delete this comment -->
I believe that the artificial neuron is the one that is the most interesting to me personally, and I also believe that, minus some need for research on machine learning algorithms, the component would likely be fairly simple to implement. At the most basic level, it essentially functions as a calculator; evaluating values based on a pre-set formula and outputting a result.

> Once you've argued your choice of design, make a branch in your new repo called
> something like `proof-of-concept`. There are many ways to do this, but my
Expand All @@ -126,8 +117,6 @@ new; then delete this comment -->
> we'll want a branch that you can later make a pull request from with all
> your changes.

<!-- TODO: make a new branch from main then delete this comment -->

## Assignment Tasks

As stated previously, your goal with this assignment is to produce a Java
Expand All @@ -153,8 +142,6 @@ completed the assignment.

### Changelog

<!-- TODO: update CHANGELOG then delete this comment -->

At the end of every assignment, you should update the
[CHANGELOG.md](../../CHANGELOG.md) file found in the root of the project folder.
Here's what I would expect to see at the minimum:
Expand Down
10 changes: 3 additions & 7 deletions doc/03-component-interfaces/03-component-interfaces.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Portfolio Part 3: Component Interfaces

- **Name**: <!-- TODO: fill with first and last name (e.g., Brutus Buckeye) and delete this comment -->
- **Dot Number**: <!-- TODO: fill with OSU dot number (e.g., buckeye.17) and delete this comment -->
- **Due Date**: <!-- TODO: fill out with due date and time (e.g., 10/17 @ 3:10 PM EST) and delete this comment -->
- **Name**: Grace Metz
- **Dot Number**: metz.403
- **Due Date**: 10/23 12:40pm

## Assignment Overview

Expand Down Expand Up @@ -132,8 +132,6 @@ hierarchy diagram using whatever tools you would like. Then, include a picture
of it in this folder. You may also embed it just below using markdown syntax
(i.e., `![ALT TEXT](path/to/file)`).

<!-- TODO: make a diagram of your component hierarchy then delete this comment -->

To start making your interfaces, make a branch off of main in your new repo
called something like `interfaces`. There are many ways to do this, but my
preference is to use GitHub Desktop. From there, you can click the `Branch`
Expand All @@ -154,8 +152,6 @@ to see them. If you don't like this workflow, you may try following the
rebase strategies described [here](https://stackoverflow.com/questions/35790561/working-while-waiting-for-pending-pr)
and [here](https://stackoverflow.com/questions/18021888/continue-working-on-a-git-branch-after-making-a-pull-request).

<!-- TODO: make a new branch from main then delete this comment -->

## Assignment Tasks

Your primary task for this assignment is to draft two interfaces in line with
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Portfolio Part 4: Abstract Class

- **Name**: <!-- TODO: fill with first and last name (e.g., Brutus Buckeye) and delete this comment -->
- **Dot Number**: <!-- TODO: fill with OSU dot number (e.g., buckeye.17) and delete this comment -->
- **Due Date**: <!-- TODO: fill out with due date and time (e.g., 10/17 @ 3:10 PM EST) and delete this comment -->
- **Name**: Grace Metz
- **Dot Number**: Metz.403
- **Due Date**: 10/31 11:40am

## Assignment Overview

Expand Down
7 changes: 7 additions & 0 deletions lib/components (3).jar_unzipped/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.10.12
Created-By: 19.0.1+10-21 (Oracle Corporation)
Built-By: Paolo Bucci
Sealed: false
Built-On: 2023-01-01 10:30:08

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions src/Neuron.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

/**
* Interface for additional methods within the Artificial Neuron component.
*
* @author Grace Metz
*
*/
public interface Neuron extends NeuronKernel {

/**
* Using the sigmoid activation function: an output >= 0.5 means a yes, or
* the neuron has fired.
*
* @return whether the neuron has fired.
*/
boolean activate();

/**
* Set an object's weight and ensure they are usable by the neuron.
*
* @param value
* the weight being entered
*/
void setWeight(double value);

/**
* Sum the weights.
*
* @return the sum of the weights.
*/
double sum();

}
46 changes: 46 additions & 0 deletions src/NeuronKernel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import components.queue.Queue;
import components.queue.Queue1L;
import components.standard.Standard;

/**
* Interface for the essential methods and values within the Artificial Neuron
* component.
*
* @author Grace Metz
*
*/
public interface NeuronKernel extends Standard<Neuron> {

/**
* Queue of Strings to represent the values of each input.
*/
Queue<String> inputs = new Queue1L<>();

/**
* Queue of values to represent the weights of each input.
*/
Queue<Double> weights = new Queue1L<>();

/**
* Retrieve the weight assigned to the inputs within this node.
*
* @return the queue of weight values
*/
Queue<Double> weights();

/**
* Return the inputs entered into the neuron.
*
* @return the queue of input Strings
*/
Queue<String> inputs();

/**
* Ensure that inputs are valid and usable by the neuron.
*
* @param value
* the String value being entered
*/
void setInput(String value);

}
86 changes: 86 additions & 0 deletions src/NeuronSecondary.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/**
* Layered implementations of secondary methods for {@code Neuron}.
*/
public abstract class NeuronSecondary implements Neuron {

/**
* Using the sigmoid activation function: an output >= 0.5 means a yes, or
* the neuron has fired.
*
* @return whether the neuron has fired.
*/
@Override
public boolean activate() {
double s = 1.0 / (1.0 + Math.exp(this.sum()));
boolean fired = false;

if (s >= 0.5) {
fired = true;
}

return fired;
}

/**
* Enter a weight to be used by the neuron.
*
* @param value
* the weight being entered
*/
@Override
public void setWeight(double value) {
this.weights.enqueue(value);
}

/**
* Sum the weights.
*
* @return the sum of the weights.
*/
@Override
public double sum() {
double sum = 0;
double weight = 0;
if (this.weights.length() > 0) {
weight = this.weights.dequeue();
sum = this.sum() + weight;
}
this.weights.enqueue(weight);

return sum;
}

/**
* Return the data in the Neuron component as a string.
*
* @return the String representing the Neuron.
*/
@Override
public String toString() {
StringBuilder result = new StringBuilder();
result.append("Neuron [weights=");
result.append(this.weights.toString());
result.append("]");
result.append("[inputs=");
result.append(this.inputs.toString());
result.append("]");
return result.toString();
}

/**
* Return whether or not this equals an object.
*
* @return whether this equals an object.
*/
@Override
public boolean equals(Object o) {
Neuron object = this.newInstance();

if (!(o == null || this.getClass() != o.getClass())) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take a peek at how this is implemented in the common methods slides.

object = (Neuron) o;
}

return this.weights.equals(object.weights)
&& this.inputs.equals(object.inputs);
}
}
Loading